/* ═══════════════════════════════════════════════════════
   CSS 변수 시스템 (H1 — 팀컬러·브랜드컬러 일원화)
   ═══════════════════════════════════════════════════════ */
:root {
    /* 배경 계층 */
    --bg-dark:     #1a1a2e;
    --bg-surface:  #16213e;
    --bg-elevated: #0f3460;
    --bg-deep:     #121d36;
    --bg-card:     #0d1525;

    /* 브랜드 액센트 */
    --accent:      #e94560;
    --accent-dim:  rgba(233, 69, 96, 0.18);
    --accent-glow: rgba(233, 69, 96, 0.35);

    /* 텍스트 계층 */
    --text-primary:   #e0e0e0;
    --text-secondary: #c0c0d0;
    --text-muted:     #a0a0b0;
    --text-faint:     #6b7a99;

    /* 보더 */
    --border-default: #0f3460;
    --border-subtle:  #1e3a5f;

    /* 팀 기본 컬러 (팀 선택 시 JS에서 --team-color-a/b 오버라이드) */
    --team-a: #2563eb;
    --team-b: #dc2626;

    /* 상태 컬러 */
    --color-win:  #15803d;
    --color-draw: #a16207;
    --color-loss: #b91c1c;

    /* 폰트 */
    --font-base: 'Pretendard', 'Noto Sans KR', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

    /* 트랜지션 */
    --trans-fast: 0.15s ease;
    --trans-base: 0.2s ease;
    --trans-slow: 0.3s ease;
}

/* ── 접근성: 글로벌 포커스 링 (M1) ── */
:focus { outline: none; }
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 3px;
}

/* ── 로딩 스켈레톤 / 펄스 (H3) ── */
@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
@keyframes loading-pulse {
    0%, 100% { opacity: 0.45; }
    50%       { opacity: 1; }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-elevated) 25%,
        var(--bg-surface)  50%,
        var(--bg-elevated) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s infinite linear;
    border-radius: 4px;
    color: transparent !important;
    pointer-events: none;
}

.loading-pulse {
    animation: loading-pulse 1.4s ease-in-out infinite;
}

/* ── 스피너 (작은 인라인 로딩 표시) ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid var(--border-subtle);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-base);
    line-height: 1.5;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    display: flex;
    flex-direction: column;
}

/* Toolbar */
#toolbar {
    display: flex;
    align-items: center;
    padding: clamp(6px, 0.8vh, 10px) clamp(10px, 1.5vw, 20px);
    background: var(--bg-surface);
    border-bottom: 2px solid var(--bg-elevated);
    flex-shrink: 0;
    position: relative;
    transition: background 0.4s ease;
}

/* 사용자 메뉴 (헤더 우측) */
#user-menu {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.78rem;
    color: var(--text-secondary, #c8d8f0);
    padding: 4px 10px 4px 6px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
}
.user-avatar {
    width: 24px; height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(126,207,255,0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #7ecfff;
    font-weight: 700;
    font-size: 0.78rem;
    border: 1px solid rgba(126,207,255,0.25);
}
.user-name {
    font-weight: 600;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-logout {
    font-size: 0.7rem;
    color: #8aa0bb;
    text-decoration: none;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.08);
    transition: all 0.15s;
}
.user-logout:hover {
    color: #f87171;
    border-color: rgba(248,113,113,0.4);
    background: rgba(248,113,113,0.06);
}
.user-logout:focus-visible {
    outline: 2px solid rgba(126,207,255,0.5);
    outline-offset: 1px;
}

#toolbar-team-strip {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    transition: background 0.4s ease;
    pointer-events: none;
}

#toolbar h1 {
    font-size: 1.3rem;
    color: var(--accent);
    letter-spacing: 1px;
    white-space: nowrap;
}

/* ── 왼쪽 세로 툴바 ──────────────────────────────────── */
#left-toolbar {
    width: 148px;
    flex-shrink: 0;
    background: var(--bg-surface);
    border: 1px solid var(--bg-elevated);
    border-radius: 8px 0 0 8px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 6px;
    overflow-y: visible;
    align-self: stretch;
}

.ltb-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ltb-grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.ltb-span2 {
    grid-column: 1 / -1;
}

.ltb-group.color-swatches {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
}

.ltb-divider {
    height: 1px;
    background: var(--bg-elevated);
    margin: 6px 0;
}

.ltb-label {
    font-size: 11px;
    color: #ccc;
    text-align: center;
}

.layer-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.layer-select-btn {
    flex: 1;
    padding: 4px 6px;
    border-radius: 5px;
    border: 1px solid var(--bg-elevated);
    background: var(--bg-dark);
    color: var(--text-muted);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.layer-select-btn:hover {
    border-color: #4a90d9;
    color: #fff;
}

.layer-select-btn.active {
    background: #1a3a5c;
    border-color: #4a90d9;
    color: #7ab8e8;
    font-weight: 600;
}

.layer-vis-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 4px;
    border: 1px solid var(--bg-elevated);
    background: transparent;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.layer-vis-btn:hover {
    background: var(--bg-elevated);
}

.layer-vis-btn.layer-hidden {
    opacity: 0.4;
}

.ltb-speed {
    gap: 3px;
}

.ltb-speed-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ltb-speed-row input[type=range] {
    flex: 1;
    cursor: pointer;
    writing-mode: horizontal-tb;
    min-width: 0;
}

.ltb-speed-val {
    font-size: 12px;
    color: #fff;
    text-align: center;
    min-width: 28px;
    flex-shrink: 0;
}

/* 왼쪽 툴바 버튼 */
#left-toolbar .mode-btn,
#left-toolbar .action-btn {
    width: 100%;
    padding: 5px 3px;
    font-size: 0.72rem;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

#formation-select {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--bg-elevated);
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
}

#formation-select:hover {
    border-color: var(--accent);
}

.mode-btn, .action-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border: 1px solid var(--bg-elevated);
    border-radius: 6px;
    background: var(--bg-dark);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-btn:hover, .action-btn:hover {
    border-color: var(--accent);
    background: rgba(233, 69, 96, 0.1);
    color: #fff;
}

.mode-btn.active {
    background: rgba(233, 69, 96, 0.18);
    border-color: var(--accent);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--accent);
    font-weight: 700;
}

.mode-btn:active, .action-btn:active {
    transform: scale(0.97);
    transition: transform 0.08s ease;
}

.action-btn {
    background: var(--bg-elevated);
}

.action-btn:hover {
    background: var(--accent);
}

.legend {
    margin-left: auto;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 12px;
}

.legend-item::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.team-a::before {
    background: var(--team-color, #2563eb);
}

.team-b::before {
    background: var(--team-color, #dc2626);
}

/* Team Banner */
#team-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(10px, 2vw, 24px);
    padding: clamp(6px, 0.8vh, 12px) clamp(10px, 1.5vw, 20px);
    background: linear-gradient(135deg, #0f1a33 0%, var(--bg-surface) 50%, #0f1a33 100%);
    border-bottom: 1px solid var(--bg-elevated);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.team-slot {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1vw, 14px);
    padding: clamp(5px, 0.6vh, 8px) clamp(10px, 1.5vw, 20px);
    background: rgba(255,255,255,0.03);
    border: 1px solid #1e3a5f;
    border-radius: 12px;
    min-width: clamp(180px, 22vw, 280px);
    transition: border-color 0.2s;
}

.team-slot:hover {
    border-color: var(--accent);
}

.team-slot-badge {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.1rem;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.2);
    transition: all 0.3s;
    overflow: hidden;
}

.team-slot-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#badge-a {
    background: #2563eb;
    color: #fff;
}

#badge-b {
    background: #dc2626;
    color: #fff;
}

.badge-letter {
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 1px;
}

.team-slot-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.team-slot-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

/* 팀 배너 부가 정보 (시즌 + 폼) */
.team-slot-sub {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    min-height: 18px;
}
.sub-league {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--bg-elevated);
    color: #7ec8e3;
}
.sub-season {
    font-size: 0.6rem;
    color: #8899aa;
}
.sub-form {
    display: flex;
    gap: 2px;
}
.fb {
    display: inline-block;
    width: 16px; height: 16px;
    border-radius: 3px;
    font-size: 0.55rem;
    font-weight: 700;
    text-align: center;
    line-height: 16px;
    color: #fff;
    cursor: default;
}
.fb-w { background: #15803d; }
.fb-d { background: #a16207; }
.fb-l { background: #b91c1c; }

.team-slot-controls {
    display: flex;
    gap: 4px;
    align-items: center;
}

.team-pick-btn {
    padding: 3px 10px;
    font-size: 0.72rem;
    border-radius: 4px;
    border: 1px solid var(--bg-elevated);
    background: var(--bg-dark);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.team-pick-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.kit-toggle-btn {
    padding: 2px 7px;
    font-size: 0.62rem;
    font-weight: 700;
    border-radius: 3px;
    border: 1px solid var(--bg-elevated);
    background: var(--bg-dark);
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}

.kit-toggle-btn:hover {
    border-color: var(--accent);
    color: #bbb;
}

.kit-toggle-btn.active {
    background: var(--bg-elevated);
    border-color: #4a90d9;
    color: #fff;
}

.kit-toggle-btn[data-kit="away"].active {
    background: #e8e8e8;
    border-color: #ccc;
    color: #222;
}

.icon-color-label {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    font-size: 0.7rem;
    color: #666;
    user-select: none;
}

.icon-color-label:hover { color: #aaa; }

.icon-fill-color,
.icon-border-color {
    width: 20px;
    height: 20px;
    padding: 1px;
    border: 1px solid var(--bg-elevated);
    border-radius: 4px;
    background: var(--bg-dark);
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.icon-fill-color:hover,
.icon-border-color:hover { border-color: var(--accent); }

.icon-fill-color::-webkit-color-swatch-wrapper,
.icon-border-color::-webkit-color-swatch-wrapper { padding: 1px; }

.icon-fill-color::-webkit-color-swatch,
.icon-border-color::-webkit-color-swatch { border: none; border-radius: 2px; }

.formation-select-team {
    padding: 2px 6px;
    font-size: 0.72rem;
    border-radius: 4px;
    border: 1px solid var(--bg-elevated);
    background: var(--bg-dark);
    color: var(--text-secondary);
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, color 0.2s;
    max-width: 80px;
}

.formation-select-team:hover {
    border-color: var(--accent);
    color: #fff;
}

.team-banner-vs {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--accent);
    text-shadow: 0 0 12px rgba(233,69,96,0.4);
    letter-spacing: 2px;
}

/* Team Modal */
.team-modal-content {
    width: 660px;
    max-width: 92vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.league-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--bg-elevated);
}

.league-tab {
    flex: 1;
    padding: 8px;
    border: none;
    background: var(--bg-dark);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.league-tab:hover {
    color: #fff;
}

.league-tab.active {
    background: var(--bg-elevated);
    color: #fff;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    padding-right: 4px;
    margin-bottom: 16px;
}

.team-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #1e3a5f;
    border-radius: 10px;
    background: var(--bg-dark);
    cursor: pointer;
    transition: all 0.2s;
}

.team-card:hover {
    border-color: var(--accent);
    background: #1e2740;
    transform: translateY(-1px);
}

.team-card.selected {
    border-color: var(--accent);
    background: rgba(233,69,96,0.12);
    box-shadow: 0 0 8px rgba(233,69,96,0.2);
}

.team-card-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.65rem;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.15);
    line-height: 1.1;
    text-align: center;
    overflow: hidden;
}

.team-card-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.team-card-name {
    font-size: 0.78rem;
    color: #d0d0d0;
    line-height: 1.2;
    word-break: keep-all;
}

/* Toolbar extras */
.toolbar-sep {
    color: var(--bg-elevated);
    font-size: 1.1rem;
    user-select: none;
}

.color-swatches {
    gap: 5px !important;
}

.color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--bg-elevated);
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}

.color-swatch:nth-child(1) { background: rgba(255,255,255,0.85); }
.color-swatch:nth-child(2) { background: rgba(255,68,68,0.9); }
.color-swatch:nth-child(3) { background: rgba(68,170,255,0.9); }
.color-swatch:nth-child(4) { background: rgba(255,221,0,0.9); }
.color-swatch:nth-child(5) { background: rgba(68,255,100,0.9); }
.color-swatch:nth-child(6) { background: rgba(255,140,0,0.9); }

.color-swatch:hover {
    transform: scale(1.2);
}

.color-swatch.active {
    border-color: var(--accent);
    box-shadow: 0 0 6px rgba(233,69,96,0.5);
    transform: scale(1.15);
}

/* Main area: canvas + bench side-by-side */
#main-area {
    flex: 1 1 auto;
    display: flex;
    flex-direction: row;
    height: clamp(480px, 75vh, 1000px);
    min-width: 0;
}

/* Canvas */
#canvas-container {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 8px;
    gap: 0;
}

#field-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

/* 포메이션 HUD (전술판 상단) ────────────────────────── */
#formation-hud {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    column-gap: clamp(10px, 1.4vw, 18px);
    row-gap: clamp(8px, 1.2vh, 14px);
    padding: clamp(12px, 1.8vh, 22px) clamp(18px, 2.2vw, 30px);
    width: fit-content;
    max-width: min(100%, 760px);
    margin: 0 auto;
    border-radius: clamp(22px, 3vh, 34px);
    background: linear-gradient(135deg, rgba(15, 22, 41, 0.88), rgba(22, 33, 62, 0.92));
    border: 1px solid rgba(233, 69, 96, 0.25);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    user-select: none;
    z-index: 5;
}

.fhud-block {
    display: flex;
    align-items: center;
    gap: clamp(6px, 0.7vw, 10px);
    flex-wrap: nowrap;
}

.fhud-block-a { padding-right: clamp(4px, 0.5vw, 8px); border-right: 1px solid rgba(255,255,255,0.08); }
.fhud-block-b { padding-left:  clamp(4px, 0.5vw, 8px); border-left:  1px solid rgba(255,255,255,0.08); }

/* 팀 칩 (엠블럼 + 팀 이름, 클릭시 팀 선택 모달) */
.fhud-team-chip {
    display: inline-flex;
    align-items: center;
    gap: clamp(5px, 0.6vw, 8px);
    padding: 4px clamp(8px, 1vw, 12px) 4px 4px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(13, 21, 37, 0.55);
    color: #fff;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
    max-width: clamp(120px, 14vw, 190px);
    min-width: 0;
}
.fhud-block-b .fhud-team-chip {
    padding: 4px 4px 4px clamp(8px, 1vw, 12px);
    flex-direction: row-reverse;
}
.fhud-team-chip:hover {
    border-color: rgba(255, 209, 102, 0.55);
    background: rgba(22, 33, 62, 0.75);
}
.fhud-team-chip:active { transform: scale(0.97); }

.fhud-chip-badge {
    width: clamp(22px, 2vw, 28px);
    height: clamp(22px, 2vw, 28px);
    border-radius: 50%;
    background: linear-gradient(135deg, #1e5f9e, #2c7dc9);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
}
.fhud-block-b .fhud-chip-badge {
    background: linear-gradient(135deg, #b92b3e, var(--accent));
}
.fhud-chip-badge img {
    width: 85%;
    height: 85%;
    object-fit: contain;
}
.fhud-chip-letter {
    font-weight: 900;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.fhud-chip-name {
    font-size: clamp(0.74rem, 0.9vw, 0.9rem);
    font-weight: 800;
    letter-spacing: 0.03em;
    max-width: clamp(70px, 9vw, 130px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 킷 토글 (H/A 세그먼트 버튼) */
.fhud-kit-group {
    display: inline-flex;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 7px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px;
    gap: 2px;
    flex-shrink: 0;
}
.fhud-kit-btn {
    width: clamp(20px, 1.8vw, 24px);
    height: clamp(20px, 1.8vw, 24px);
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    font-size: clamp(0.62rem, 0.75vw, 0.74rem);
    font-weight: 900;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.fhud-kit-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}
.fhud-kit-btn.active {
    color: #0d1525;
    background: linear-gradient(180deg, #ffd166, #f2a900);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.fhud-vs {
    font-size: clamp(0.65rem, 0.85vw, 0.8rem);
    font-weight: 900;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.55);
    padding: 0 clamp(2px, 0.4vw, 6px);
    flex-shrink: 0;
}

#formation-hud select.formation-select-team {
    background: #0d1525;
    color: #ffd166;
    border: 1px solid rgba(233, 69, 96, 0.35);
    border-radius: 8px;
    padding: 5px clamp(24px, 2.4vw, 30px) 5px clamp(9px, 1vw, 13px);
    font-size: clamp(0.78rem, 0.95vw, 0.92rem);
    font-weight: 800;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    letter-spacing: 0.05em;
    min-width: clamp(68px, 7.5vw, 90px);
    flex-shrink: 0;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><polygon points='0,0 10,0 5,6' fill='%23ffd166'/></svg>");
    background-repeat: no-repeat;
    background-position: right 9px center;
    transition: border-color 0.15s, box-shadow 0.15s;
}
#formation-hud select.formation-select-team:hover {
    border-color: rgba(233, 69, 96, 0.6);
    box-shadow: 0 0 0 1px rgba(233, 69, 96, 0.3);
}
#formation-hud select.formation-select-team:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(233, 69, 96, 0.35);
}

#formation-hud .formation-save-btn {
    width: clamp(24px, 2vw, 28px);
    height: clamp(24px, 2vw, 28px);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: #ffd166;
    font-weight: 900;
    font-size: clamp(0.9rem, 1vw, 1.05rem);
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
#formation-hud .formation-save-btn:hover {
    background: rgba(255, 209, 102, 0.15);
    border-color: rgba(255, 209, 102, 0.4);
    transform: scale(1.06);
}
#formation-hud .formation-save-btn:active {
    transform: scale(0.96);
}

@media (max-width: 720px) {
    #formation-hud { gap: 8px; padding: 6px 12px; }
    .fhud-chip-name { display: none; }
    .fhud-team-chip,
    .fhud-block-b .fhud-team-chip { padding: 4px; }
}

/* Bench Panel */
#bench-panel {
    width: clamp(150px, 14vw, 220px);
    flex-shrink: 0;
    background: #121d36;
    border: 1px solid var(--bg-elevated);
    border-radius: 0 8px 8px 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    align-self: stretch;
}

.bench-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-bottom: 1px solid var(--bg-elevated);
}

.bench-section:last-child {
    border-bottom: none;
}

/* ── 분석 위젯 ─────────────────────────────────────────────── */
#analytics-widget-area {
    padding: 8px;
    border-top: 1px solid var(--bg-elevated);
    flex-shrink: 0;
}
.analytics-widget-btn {
    width: 100%;
    background: linear-gradient(135deg, rgba(30,50,100,0.9) 0%, rgba(20,35,75,0.95) 100%);
    border: 1px solid rgba(78,164,248,0.25);
    border-radius: 10px;
    padding: 10px 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}
.analytics-widget-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(78,164,248,0.08), rgba(184,126,248,0.08));
    opacity: 0;
    transition: opacity 0.2s;
}
.analytics-widget-btn:hover {
    border-color: rgba(78,164,248,0.55);
    box-shadow: 0 0 14px rgba(78,164,248,0.18);
    transform: translateY(-1px);
}
.analytics-widget-btn:hover::before { opacity: 1; }
.analytics-widget-btn:active { transform: translateY(0); }
.aw-icon {
    font-size: 1.4rem;
    line-height: 1;
    filter: drop-shadow(0 0 6px rgba(78,164,248,0.5));
}
.aw-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #7eb8ff;
    letter-spacing: 0.03em;
}
.aw-sub {
    font-size: 0.6rem;
    color: #4a6a8a;
    letter-spacing: 0.02em;
}

.bench-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--bg-elevated);
    flex-shrink: 0;
}

.bench-team-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.bench-add-btn {
    padding: 3px 8px;
    font-size: 0.7rem;
    border: 1px solid var(--bg-elevated);
    border-radius: 4px;
    background: #0d7c3e;
    border-color: #15a050;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.bench-add-btn:hover {
    background: #15a050;
}

.bench-players {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.bench-player-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 6px;
    margin-bottom: 3px;
    background: rgba(255,255,255,0.03);
    border: 1px solid transparent;
    transition: all 0.15s;
}

.bench-player-item:hover {
    border-color: #1e3a5f;
    background: rgba(255,255,255,0.06);
}

.bench-player-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    border: 1.5px solid rgba(255,255,255,0.3);
}

.bench-player-name {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bench-player-remove {
    background: none;
    border: none;
    color: #555;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
}

.bench-player-edit {
    background: none;
    border: none;
    color: #555;
    font-size: 0.72rem;
    cursor: pointer;
    padding: 0 3px;
    line-height: 1;
    flex-shrink: 0;
}

.bench-player-edit:hover {
    color: #4a90d9;
}

/* 선수 상태 (부상/출전정지) */
.bench-status-btn { font-size: 0.65rem; }
.bench-status-icon { margin-right: 2px; }
.bench-player-injured { opacity: 0.5; }
.bench-player-injured .bench-player-name { text-decoration: line-through; color: #f87171; }
.bench-player-suspended { opacity: 0.5; }
.bench-player-suspended .bench-player-name { text-decoration: line-through; color: #fb923c; }
.bench-player-doubtful .bench-player-name { color: #fbbf24; }

.bench-player-remove:hover {
    color: var(--accent);
}

.bench-squad-bar {
    display: flex;
    gap: 4px;
    padding: 6px;
    border-top: 1px solid var(--bg-elevated);
    flex-shrink: 0;
}

.squad-btn {
    flex: 1;
    padding: 4px;
    font-size: 0.65rem;
    border: 1px solid var(--bg-elevated);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.squad-save-btn {
    background: #0d5c2e;
    border-color: #15a050;
    color: #afd8bf;
}

.squad-save-btn:hover {
    background: #15a050;
    color: #fff;
}

.squad-load-btn {
    background: #5a3d0d;
    border-color: #7c5a1a;
    color: #e0c080;
}

.squad-load-btn:hover {
    background: #7c5a1a;
    color: #fff;
}

.team-reset-btn {
    background: #4a1010;
    border-color: #8b2020;
    color: #e08080;
}

.team-reset-btn:hover {
    background: #8b2020;
    color: #fff;
}

#field {
    display: block;
    border-radius: 4px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

/* Save / Load buttons */
.save-btn {
    background: #0d7c3e !important;
    border-color: #15a050 !important;
}

.save-btn:hover {
    background: #15a050 !important;
}

.load-btn {
    background: #7c3a0d !important;
    border-color: #a0581b !important;
}

.load-btn:hover {
    background: #a0581b !important;
}

.export-btn {
    background: #1a5276 !important;
    border-color: #2980b9 !important;
}
.export-btn:hover {
    background: #2980b9 !important;
}

/* 커스텀 포메이션 저장 버튼 */
.formation-save-btn {
    width: 22px; height: 22px;
    padding: 0; margin-left: 3px;
    border: 1px solid var(--bg-elevated);
    border-radius: 4px;
    background: var(--bg-surface);
    color: #4ec9b0;
    font-size: 14px; font-weight: bold;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
}
.formation-save-btn:hover {
    background: #0d7c3e;
    border-color: #15a050;
    color: #fff;
}

/* ── 경기별 히트맵 선택 패널 ─────────────────────────── */
#match-picker {
    position: fixed;
    top: 60px;
    right: 12px;
    width: 420px;
    max-height: calc(100vh - 80px);
    background: #1a1e28;
    border: 1px solid #3a3f52;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    z-index: 200;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    overflow: hidden;
}
#match-picker.hidden { display: none; }

#match-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #252a3a;
    border-bottom: 1px solid #3a3f52;
    flex-shrink: 0;
}
#match-picker-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e0e4f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#match-picker-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1rem;
    cursor: pointer;
    padding: 2px 4px;
    flex-shrink: 0;
}
#match-picker-close:hover { color: #fff; }

#match-picker-list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    overflow-y: auto;
    flex: 1;
}
.mp-loading, .mp-empty {
    padding: 12px;
    color: #888;
    font-size: 0.8rem;
    text-align: center;
}
.mp-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #c0c6d8;
    border-bottom: 1px solid #2a2f40;
    transition: background 0.15s;
}
.mp-item:hover { background: #252a3a; }
.mp-item.active { background: #1a3a5c; color: #7bbfff; }
.mp-item-all { font-weight: 600; color: #a0c4ff; }
.mp-check { flex-shrink: 0; width: 16px; font-size: 0.9rem; color: #7bbfff; }
.mp-date { flex-shrink: 0; color: #888; width: 38px; }
.mp-badge { flex-shrink: 0; font-size: 0.65rem; font-weight: 700; padding: 1px 6px; border-radius: 3px; }
.mp-home { background: #1a4a8a; color: #7bbfff; }
.mp-away { background: #5a1a1a; color: #ff9a9a; }
.mp-home-team { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.mp-vs { flex-shrink: 0; color: #555; padding: 0 4px; font-size: 0.7rem; }
.mp-away-team { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-score { flex-shrink: 0; font-weight: 600; color: #e0e4f0; min-width: 28px; text-align: right; }

.play-btn {
    background: #1a5fa8 !important;
    border-color: #2a7fd4 !important;
    font-weight: bold;
}

.play-btn:hover {
    background: #2a7fd4 !important;
}

.play-btn:disabled {
    background: #555 !important;
    border-color: #777 !important;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.modal-content {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--bg-elevated);
    border-radius: 12px;
    padding: 24px 28px;
    width: 380px;
    max-width: 90vw;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 16px;
}

.modal-content label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.modal-content input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--bg-elevated);
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    margin-bottom: 20px;
}

.modal-content input[type="text"]:focus {
    border-color: var(--accent);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-btn {
    padding: 7px 18px;
    border-radius: 6px;
    border: 1px solid var(--bg-elevated);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-btn.cancel {
    background: var(--bg-dark);
    color: var(--text-secondary);
}

.modal-btn.cancel:hover {
    border-color: var(--accent);
    color: #fff;
}

.modal-btn.confirm {
    background: #0d7c3e;
    border-color: #15a050;
    color: #fff;
}

.modal-btn.confirm:hover {
    background: #15a050;
}

/* Load modal - saves list */
.load-modal-content {
    width: 460px;
    max-width: 92vw;
}

.saves-list {
    max-height: 350px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.saves-list .empty-msg {
    text-align: center;
    color: #666;
    padding: 24px;
    font-size: 0.9rem;
}

.save-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border: 1px solid var(--bg-elevated);
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--bg-dark);
    transition: border-color 0.2s;
}

.save-item:hover {
    border-color: var(--accent);
}

.save-item-info {
    flex: 1;
    min-width: 0;
}

.save-item-name {
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.save-item-meta {
    font-size: 0.75rem;
    color: #666;
    margin-top: 2px;
}

.save-item-actions {
    display: flex;
    gap: 6px;
    margin-left: 12px;
    flex-shrink: 0;
}

.save-item-actions button {
    padding: 5px 12px;
    border-radius: 5px;
    border: 1px solid var(--bg-elevated);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
}

.save-item-actions .btn-load-item {
    background: var(--bg-elevated);
    color: #fff;
}

.save-item-actions .btn-load-item:hover {
    background: #2563eb;
}

.save-item-actions .btn-overwrite-item {
    background: #5a3d0d;
    color: #e0c080;
    border-color: #7c5a1a;
}

.save-item-actions .btn-overwrite-item:hover {
    background: #7c5a1a;
    color: #fff;
}

.save-item-actions .btn-delete-item {
    background: #3d0d0d;
    color: #e08080;
    border-color: #7c1a1a;
}

.save-item-actions .btn-delete-item:hover {
    background: #7c1a1a;
    color: #fff;
}

.save-item-actions .btn-link-item {
    background: #0d2a3a;
    color: #7ab8d4;
    border-color: #1a4a63;
    padding: 5px 9px;
    font-size: 0.85rem;
}

.save-item-actions .btn-link-item:hover {
    background: #1a4a63;
    color: #fff;
}

/* 경기 라인업 불러오기 모달 */
.match-load-modal-content {
    width: 560px;
    max-width: 92vw;
}
.match-load-hint {
    color: #9aa4c8;
    font-size: 0.82rem;
    margin: -4px 0 12px 0;
    line-height: 1.4;
}
.match-load-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--bg-elevated);
    border-radius: 8px;
    flex-wrap: wrap;
}
.match-load-toolbar label {
    color: #c0c8e0;
    font-size: 0.85rem;
    margin: 0;
}
.match-load-toolbar input[type="date"] {
    background: #0d1625;
    color: var(--text-primary);
    border: 1px solid #2d3a5f;
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 0.85rem;
    color-scheme: dark;
}
.match-load-check {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    cursor: pointer;
}
.match-item {
    display: grid;
    grid-template-columns: 58px 1fr 1fr 80px;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--bg-elevated);
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--bg-dark);
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}
.match-item:hover {
    border-color: var(--accent);
    background: #202038;
}
.match-item.no-lineup {
    opacity: 0.55;
    cursor: not-allowed;
}
.match-item.no-lineup:hover {
    border-color: var(--bg-elevated);
    background: var(--bg-dark);
}
.match-item-kickoff {
    font-size: 0.82rem;
    color: #c0c8e0;
    font-variant-numeric: tabular-nums;
}
.match-item-league {
    font-size: 0.62rem;
    color: #9aa4c8;
    margin-top: 2px;
    letter-spacing: 0.04em;
}
.match-item-team {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.match-item-team.away { justify-content: flex-end; }
.match-item-team img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}
.match-item-team-name {
    font-size: 0.88rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.match-item-score {
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: #ffd166;
    font-variant-numeric: tabular-nums;
}
.match-item-score.no-score { color: #666; font-weight: 500; }
.match-item-nolu {
    grid-column: 1 / -1;
    font-size: 0.7rem;
    color: #e08080;
    margin-top: 4px;
}
.match-load-btn {
    background: linear-gradient(135deg, #1e5f9e 0%, #2c7dc9 100%) !important;
    color: #fff !important;
    border-color: #1e5f9e !important;
}
.match-load-btn:hover {
    background: linear-gradient(135deg, #2c7dc9 0%, #3a9ae0 100%) !important;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 24px;
    border-radius: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--bg-elevated);
    color: var(--text-primary);
    font-size: 0.9rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

.toast.toast-has-action {
    pointer-events: auto;
    padding: 8px 14px 8px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.toast-link-btn {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 4px 11px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}

.toast-link-btn:hover {
    background: #1d4ed8;
}

/* Slot Picker */
.slot-picker {
    position: fixed;
    z-index: 1600;
    background: var(--bg-surface);
    border: 1px solid var(--bg-elevated);
    border-radius: 10px;
    padding: 10px 12px;
    width: 210px;
    max-height: 300px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0,0,0,0.7);
}

.slot-picker.hidden { display: none; }

.slot-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #e0e0ff;
}

.slot-picker-list {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.slot-picker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 7px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.slot-picker-item:hover { background: rgba(255,255,255,0.08); }

.slot-picker-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.slot-picker-name {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.slot-picker-pos {
    margin-left: auto;
    font-size: 0.68rem;
    color: #6060a0;
    background: rgba(255,255,255,0.06);
    padding: 1px 5px;
    border-radius: 3px;
}

.slot-picker-empty {
    font-size: 0.75rem;
    color: #555;
    text-align: center;
    padding: 12px 0;
}

/* Player Edit Popup */
.player-edit-popup {
    position: fixed;
    z-index: 1500;
    background: var(--bg-surface);
    border: 1px solid var(--bg-elevated);
    border-radius: 10px;
    padding: 12px 14px;
    width: 200px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    transition: opacity 0.15s;
}

.player-edit-popup.hidden {
    display: none;
}

.player-edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.player-edit-team-label {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    color: #fff;
}

.player-edit-close-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.player-edit-close-btn:hover {
    color: var(--accent);
}

.player-edit-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.player-edit-row label {
    font-size: 0.78rem;
    color: var(--text-muted);
    width: 42px;
    flex-shrink: 0;
}

.player-edit-row input {
    flex: 1;
    padding: 5px 8px;
    border-radius: 5px;
    border: 1px solid var(--bg-elevated);
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
}

.player-edit-row input:focus {
    border-color: var(--accent);
}

.player-edit-row input[type="number"] {
    width: 56px;
    flex: none;
}

.player-edit-meta {
    margin: 4px 0 6px;
    padding: 6px 8px;
    background: #0d1426;
    border-radius: 6px;
    border: 1px solid #2a2a4a;
}

.player-edit-meta.hidden { display: none; }

.player-edit-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}

.player-meta-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    letter-spacing: 0.04em;
}

.player-meta-body {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.player-meta-dob {
    font-size: 0.72rem;
    color: #7070a0;
}

.player-edit-actions {
    display: flex;
    gap: 6px;
    margin-top: 2px;
}

.player-edit-confirm-btn {
    flex: 1;
    padding: 6px;
    border-radius: 5px;
    border: 1px solid #15a050;
    background: #0d7c3e;
    color: #fff;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}
.player-edit-confirm-btn:hover { background: #15a050; }

/* 전술 노트 팝업 */
#note-popup {
    width: 224px;
}

.note-popup-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffd700;
}

.note-popup-textarea {
    width: 100%;
    box-sizing: border-box;
    background: var(--bg-dark);
    border: 1px solid var(--bg-elevated);
    border-radius: 5px;
    color: var(--text-primary);
    font-size: 0.82rem;
    padding: 6px 8px;
    resize: none;
    outline: none;
    font-family: inherit;
    line-height: 1.5;
    margin-bottom: 8px;
}

.note-popup-textarea:focus {
    border-color: #4a90d9;
}

.note-popup-actions {
    display: flex;
    gap: 6px;
}

.note-popup-delete-btn {
    flex: 1;
    padding: 6px;
    border-radius: 5px;
    border: 1px solid #7c1a1a;
    background: #3d0d0d;
    color: #e08080;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s;
}

.note-popup-delete-btn:hover {
    background: #7c1a1a;
    color: #fff;
}

.player-edit-heatmap-btn {
    flex: 1;
    padding: 6px;
    border-radius: 5px;
    border: 1px solid #7c4a0d;
    background: #5c3208;
    color: #f9a825;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.player-edit-heatmap-btn:hover { background: #7c5210; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 1100px) {
    #toolbar h1 { font-size: 1.05rem; }
    .mode-btn, .action-btn { padding: 5px 10px; font-size: 0.78rem; }
    .team-slot { min-width: clamp(160px, 30vw, 240px); }
}

@media (max-width: 820px) {
    #toolbar { gap: 6px; padding: 6px 10px; }
    #toolbar h1 { font-size: 0.9rem; }
    .mode-btn, .action-btn { padding: 4px 8px; font-size: 0.72rem; }
    .toolbar-sep { display: none; }

    #team-banner { gap: 8px; padding: 6px 10px; }
    .team-slot { min-width: 0; flex: 1; padding: 5px 10px; gap: 8px; }
    .team-slot-badge { width: 36px; height: 36px; }
    .team-slot-name { font-size: 0.8rem; }
    .team-banner-vs { font-size: 1rem; }

    #bench-panel { width: clamp(120px, 18vw, 160px); }
    .bench-team-name { font-size: 0.72rem; }
    .bench-player-name { font-size: 0.75rem; }
    .squad-btn { font-size: 0.58rem; padding: 3px; }

    .color-swatch { width: 16px; height: 16px; }
}

@media (max-width: 600px) {
    body { overflow-y: auto; }
    #app { height: auto; min-height: 100vh; }
    #main-area { flex-direction: column; }
    #bench-panel {
        width: 100%;
        flex-direction: row;
        border-left: none;
        border-top: 1px solid var(--bg-elevated);
        height: 160px;
    }
    .bench-section { flex-direction: row; border-bottom: none; border-right: 1px solid var(--bg-elevated); }
    .bench-section:last-child { border-right: none; }
    .bench-header { flex-direction: column; gap: 4px; align-items: flex-start; }
    .bench-players { max-height: 100px; }
}

/* ── 추가 정보 섹션 ───────────────────────────────────── */
#info-section {
    background: #0e1628;
    border-top: 2px solid var(--bg-elevated);
    padding: 24px clamp(16px, 4vw, 60px) 32px;
}

.info-main-layout {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

/* 공통 컨테이너 */
.info-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 16px;
}

.info-standings-sidebar {
    width: 33.333%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 540px;
    overflow-y: auto;
}

.sidebar-header {
    margin-bottom: 12px;
}

.sidebar-league-dropdown {
    width: 100%;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.sidebar-league-dropdown:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

.matchup-right-panel {
    flex: 1;
    min-width: 0;
}

#matchup-area {
    min-width: 0;
}

.info-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.info-divider::before,
.info-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--bg-elevated));
}

.info-divider::after {
    background: linear-gradient(to left, transparent, var(--bg-elevated));
}

.info-divider-label {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #4a7fc1;
    white-space: nowrap;
}

.info-controls {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.info-control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.info-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #7080a0;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.info-select {
    padding: 8px 32px 8px 12px;
    border-radius: 8px;
    border: 1px solid #1c3a6e;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%234a7fc1'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    min-width: 160px;
    transition: border-color 0.2s;
}

.info-select:hover:not(:disabled) {
    border-color: #4a7fc1;
}

.info-select:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── 매치업 비교 ──────────────────────────────────────── */
.matchup-placeholder {
    text-align: center;
    color: #3a4a6a;
    font-size: 0.85rem;
    padding: 32px 0;
    letter-spacing: 0.5px;
}

.matchup-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 32px;
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
}

.matchup-team-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.matchup-team-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.matchup-team-header.away {
    flex-direction: row-reverse;
    text-align: right;
}

.matchup-team-emblem {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 2px solid #1c3a6e;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.matchup-team-emblem img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.matchup-team-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.matchup-form-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.matchup-team-col.away .matchup-form-row {
    justify-content: flex-end;
}

.form-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    gap: 1px;
    line-height: 1;
}

.form-badge.W { background: #1a4d2e; color: #4cff80; border: 1px solid #2d7a4a; }
.form-badge.D { background: #2d2d1a; color: #ffd93d; border: 1px solid #5a5520; }
.form-badge.L { background: #4d1a1a; color: #ff6b6b; border: 1px solid #7a2d2d; }

.form-badge-date {
    font-size: 0.6rem;
    opacity: 0.85;
    font-weight: 400;
}

.matchup-form-label {
    font-size: 0.95rem;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.matchup-team-col.away .matchup-form-label {
    text-align: right;
}

.matchup-stats-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.matchup-team-col.away .matchup-stats-row {
    justify-content: flex-end;
}

.stat-pill {
    background: var(--bg-surface);
    border: 1px solid #1c3a6e;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.72rem;
    color: #8090b0;
}

.stat-pill strong {
    color: #c0d0f0;
}

.matchup-vs-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-top: 8px;
    min-width: 260px;
    width: 300px;
}

.matchup-vs-text {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 6px;
    background: linear-gradient(135deg, #4db6ff, #ffffff, #ff8a65);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px rgba(77, 182, 255, 0.4));
}

.matchup-record-box {
    background: var(--bg-surface);
    border: 1px solid #1c3a6e;
    border-radius: 16px;
    padding: 22px 28px;
    text-align: center;
    width: 100%;
}

.matchup-record-title {
    font-size: 0.9rem;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 14px;
}

.matchup-record-nums {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 6px;
    font-size: 2.6rem;
    font-weight: 900;
    margin-bottom: 6px;
    line-height: 1;
}

.matchup-record-sep {
    font-size: 1.6rem;
    color: #2a3a5a;
    font-weight: 400;
}

.matchup-record-total {
    font-size: 0.85rem;
    color: #ffffff;
    margin-top: 10px;
}

.record-w { color: #4db6ff; }
.record-d { color: #c0c0c0; }
.record-l { color: #ff8a65; }

/* 홈/원정 승률 바 */
.winrate-section {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.winrate-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.winrate-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    gap: 6px;
    flex-wrap: nowrap;
    min-width: 0;
}

.winrate-tag {
    background: #1c3a6e;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #a0b8d8;
}

.winrate-pct {
    font-size: 0.78rem;
    font-weight: 700;
    color: #c0d0f0;
}

.winrate-bar-wrap {
    height: 8px;
    background: #0f1e3a;
    border-radius: 4px;
    overflow: hidden;
}

.winrate-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.winrate-bar.home { background: linear-gradient(to right, #2d7a4a, #4cff80); }
.winrate-bar.away { background: linear-gradient(to right, #4a2d7a, #b06bff); }

@media (max-width: 700px) {
    .matchup-grid {
        grid-template-columns: 1fr;
    }
    .matchup-vs-col {
        flex-direction: row;
        justify-content: center;
        padding: 0;
    }
    .matchup-team-col.away .matchup-form-row,
    .matchup-team-col.away .matchup-stats-row {
        justify-content: flex-start;
    }
    .matchup-team-header.away {
        flex-direction: row;
        text-align: left;
    }
}

/* ── 순위표 ──────────────────────────────────────────── */
.standings-league-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #7ab3ff;
    letter-spacing: 0.08em;
    padding: 12px 16px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.standings-table-wrap { overflow-x: auto; }
.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;          /* 0.78→0.8 */
    color: #c8d6e8;
}
.standings-table thead tr { background: rgba(255,255,255,0.04); }
.standings-table th {
    padding: 7px 8px;
    font-size: 0.7rem;          /* 0.68→0.7 */
    font-weight: 600;
    color: #8aa0bb;             /* #4a6080→#8aa0bb 헤더 대비 (2.5:1→5:1+, WCAG 충족) */
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    white-space: nowrap;
}
.standings-table td {
    padding: 7px 8px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.standings-table tbody tr:last-child td { border-bottom: none; }
.standings-table tbody tr:hover { background: rgba(255,255,255,0.04); }
.col-rank { width: 28px; font-weight: 700; }
.col-team { text-align: left !important; min-width: 100px; }
.col-num  { width: 32px; }
.col-pts  { width: 36px; font-weight: 700; color: #ffffff; }
.col-recent { width: 110px; }
.rank-top { color: #4db6ff; }
.rank-mid { color: #c0c0c0; }
.standings-table td.w { color: #4db6ff; }
.standings-table td.d { color: #c0c0c0; }
.standings-table td.l { color: #ff8a65; }
.standings-table td.gd { font-weight: 600; }
.st-team-cell { display: flex; align-items: center; gap: 7px; }
.st-emblem { width: 22px; height: 22px; object-fit: contain; flex-shrink: 0; }
.st-emblem-placeholder {
    width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.st-team-name { font-size: 0.8rem; white-space: nowrap; }
.st-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: 4px;
    font-size: 0.6rem; font-weight: 700; margin: 0 1px;
}
.st-badge.W { background: rgba(77,182,255,0.2); color: #4db6ff; }
.st-badge.D { background: rgba(192,192,192,0.15); color: #c0c0c0; }
.st-badge.L { background: rgba(255,138,101,0.2); color: #ff8a65; }
@media (max-width: 900px) { .standings-wrap { flex-direction: column; } }

/* ── K리그 선수 히트맵 모달 ─────────────────────────── */
.k2-heatmap-content {
    width: 700px;
    max-width: 95vw;
    max-height: 88vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.heatmap-league-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}
.hm-league-tab {
    flex: 1;
    padding: 8px 12px;
    background: #1e2130;
    border: 1px solid #444;
    border-radius: 6px;
    color: #bbb;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.hm-league-tab:hover { background: #2a2f45; color: #fff; }
.hm-league-tab.active {
    background: #2553a5;
    border-color: #3a7fd4;
    color: #fff;
    font-weight: 600;
}
.k2-step-label { font-size: 13px; color: #aaa; margin-bottom: 6px; }
.k2-team-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.k2-team-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 6px;
    border-radius: 8px;
    border: 2px solid #444;
    cursor: pointer;
    background: #1e2130;
    transition: background 0.15s, transform 0.1s;
    font-size: 12px;
    color: #ddd;
}
.k2-team-card:hover { background: #2a2f45; transform: scale(1.04); }
.k2-team-card img { width: 40px; height: 40px; object-fit: contain; }
.k2-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 600;
}
.k2-pos-header {
    font-size: 11px;
    color: #888;
    padding: 4px 0 2px;
    border-bottom: 1px solid #333;
    margin-top: 6px;
}
.k2-player-list { max-height: 280px; overflow-y: auto; }
.k2-player-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.12s;
}
.k2-player-row:hover { background: #2a2f45; }
.k2-player-name { font-size: 13px; }
.k2-player-meta { font-size: 11px; color: #888; }
.k2-heatmap-wrap {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}
#k2-heatmap-canvas { display: block; width: 100%; border-radius: 8px; }
.k2-loading {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 14px;
}
.k2-match-list {
    list-style: none;
    max-height: 160px;
    overflow-y: auto;
    border: 1px solid #333;
    border-radius: 6px;
}
.k2-match-item {
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    border-bottom: 1px solid #222;
    transition: background 0.12s;
}
.k2-match-item:hover { background: #2a2f45; }
.k2-match-item.active { background: #2d3a5a; color: #7eb8ff; }
.k2-match-date { color: #888; margin-right: 6px; }



/* ── VS 텍스트 ──────────────────────────────────────── */
.vs-text {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--accent);
    text-shadow: 0 0 12px rgba(233,69,96,0.4);
    letter-spacing: 2px;
}

/* ── 배너 바로 아래 매치업 패널 ─────────────────────── */
#banner-matchup {
    background: linear-gradient(180deg, #0d1530 0%, #111827 100%);
    border-bottom: 1px solid var(--bg-elevated);
    padding: 16px clamp(16px, 4vw, 48px);
    overflow-x: hidden;
}
#banner-matchup.hidden {
    display: none;
}

/* matchup-area 안의 grid는 기존 info.js CSS 재사용 */
/* info-section 아래 matchup-right-panel 최소화 */
.matchup-right-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
}

/* ── 승률 연도 탭 ─────────────────────────────────────── */
.winrate-year-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.wr-year-tab {
    padding: 2px 8px;
    font-size: 0.62rem;
    font-weight: 700;
    border-radius: 4px;
    border: 1px solid #1e3a5f;
    background: #0f1a33;
    color: #5a7090;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.3px;
}
.wr-year-tab:hover {
    border-color: #4a90d9;
    color: #ccc;
}
.wr-year-tab.active {
    background: #1e3a6e;
    border-color: #4a90d9;
    color: #7eb8ff;
}

/* ── 리그 순위 블록 ─────────────────────────────────── */
.ranking-block {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 6px;
}
.ranking-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 40px;
}
.ranking-num {
    font-size: 1.6rem;
    font-weight: 700;
    color: #7eb8ff;
    line-height: 1;
}
.ranking-total {
    font-size: 0.65rem;
    color: #6a7f9a;
    margin-top: 2px;
}
.ranking-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.ranking-year {
    font-size: 0.65rem;
    color: #6a7f9a;
}
.ranking-record {
    font-size: 0.78rem;
    color: #c8d8f0;
}
.ranking-pts {
    font-size: 0.75rem;
    color: #f0c040;
    font-weight: 600;
}
.ranking-gd {
    font-size: 0.68rem;
    color: #8aa0bb;
}

/* ── 주요 선수 블록 ─────────────────────────────────── */
.top-players-grid {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}
.top-players-section {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 8px 10px;
}
.top-players-label {
    font-size: 0.68rem;
    color: #6a7f9a;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}
.top-player-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.top-player-row:last-child { border-bottom: none; }
.top-player-rank {
    font-size: 0.65rem;
    color: #4a6080;
    min-width: 12px;
}
.top-player-name {
    flex: 1;
    font-size: 0.75rem;
    color: #c8d8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.top-player-val {
    font-size: 0.78rem;
    font-weight: 700;
    color: #7eb8ff;
    min-width: 16px;
    text-align: right;
}
.top-players-empty {
    font-size: 0.7rem;
    color: #4a6080;
}

/* ── 추가 통계 (평균득실 / streak / top scorer) ─────────── */
.extra-stats-wrap {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.extra-avg-row {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 6px 10px;
}
.extra-label { color: #7090b0; }
.extra-sep { color: #3a4a6a; }
.extra-year { font-size: 0.65rem; color: #4a6080; margin-right: 4px; }
.extra-val { font-weight: 700; }
.extra-val.goal-for  { color: #4db6ff; }
.extra-val.goal-against { color: #ff8a65; }

.extra-streak {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
}
.extra-streak.streak-w { background: rgba(76,255,128,0.1); border: 1px solid #2d7a4a; }
.extra-streak.streak-d { background: rgba(255,217,61,0.1); border: 1px solid #5a5520; }
.extra-streak.streak-l { background: rgba(255,107,107,0.1); border: 1px solid #7a2d2d; }
.streak-count { font-size: 1.1rem; }
.streak-label { font-size: 0.72rem; opacity: 0.9; }
.extra-streak.streak-w .streak-count { color: #4cff80; }
.extra-streak.streak-d .streak-count { color: #ffd93d; }
.extra-streak.streak-l .streak-count { color: #ff6b6b; }

.top-scorers-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.top-scorer-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255,255,255,0.03);
}
.ts-rank {
    width: 16px;
    text-align: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #4a6080;
}
.ts-name { flex: 1; color: #c0d0f0; }
.ts-goals { color: #ffd93d; font-weight: 700; font-size: 0.72rem; }

.matchup-team-col.away .extra-avg-row,
.matchup-team-col.away .extra-streak,
.matchup-team-col.away .top-scorer-item {
    flex-direction: row-reverse;
    text-align: right;
}

/* ── 헤더 인라인 순위 뱃지 ──────────────────────────────── */
.matchup-team-name-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.rank-inline-badge {
    display: flex;
    align-items: center;
    gap: 6px;
}
.rank-inline-num {
    font-size: 0.78rem;
    font-weight: 700;
    color: #7eb8ff;
}
.rank-inline-pts {
    font-size: 0.68rem;
    color: #f0c040;
}
.rank-inline-gd {
    font-size: 0.65rem;
    color: #8aa0bb;
}

/* ── H2H 경기 목록 ───────────────────────────────────── */
.h2h-match-list-label {
    font-size: 0.68rem;
    color: #5a7090;
    font-weight: 600;
    letter-spacing: 0.4px;
    margin: 10px 0 4px;
    text-align: center;
}
.h2h-match-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
}
.h2h-match-row {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 6px;
    background: rgba(255,255,255,0.03);
    border-radius: 5px;
    font-size: 0.72rem;
}
.h2h-date {
    color: #5a7090;
    min-width: 32px;
    font-size: 0.65rem;
}
.h2h-venue {
    min-width: 14px;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 1px 3px;
    border-radius: 3px;
    text-align: center;
}
.h2h-venue.home { background: #1a3a6a; color: #7eb8ff; }
.h2h-venue.away { background: #2a1a3a; color: #b87ef8; }
.h2h-opp {
    flex: 1;
    color: #8aa0bb;
    font-size: 0.68rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.h2h-score {
    color: #c8d8f0;
    font-weight: 600;
    min-width: 36px;
    text-align: center;
    font-size: 0.72rem;
}
.h2h-result {
    min-width: 14px;
    text-align: center;
    font-weight: 700;
    font-size: 0.72rem;
}

/* ── 하단 가로 경기 스트립 ─────────────────────────────── */
.h2h-strip {
    padding: 14px 16px 10px;
    border-top: 1px solid rgba(255,255,255,0.07);
}
.h2h-strip-label {
    font-size: 0.68rem;
    color: #5a7090;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
.h2h-strip-track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
    scrollbar-color: #2a3a5a transparent;
}
.h2h-strip-track::-webkit-scrollbar { height: 4px; }
.h2h-strip-track::-webkit-scrollbar-thumb { background: #2a3a5a; border-radius: 2px; }

/* 경기 카드 */
.h2h-card {
    flex: 0 0 160px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.h2h-card.result-W { border-left: 3px solid #4caf7a; }
.h2h-card.result-D { border-left: 3px solid #e0a030; }
.h2h-card.result-L { border-left: 3px solid #e05050; }

.h2h-card-date {
    font-size: 0.62rem;
    color: #5a7090;
}
.h2h-card-score-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}
.h2h-card-team {
    font-size: 0.68rem;
    color: #8aa0bb;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.h2h-card-team.away { text-align: right; }
.h2h-card-score {
    font-size: 0.88rem;
    font-weight: 700;
    color: #c8d8f0;
    white-space: nowrap;
    padding: 0 4px;
}
.h2h-card-venue {
    font-size: 0.6rem;
    font-weight: 600;
    text-align: center;
    padding: 1px 0;
    border-radius: 3px;
}
.h2h-card-venue.home { color: #7eb8ff; }
.h2h-card-venue.away { color: #b87ef8; }

/* 득점 선수 */
.h2h-card-scorers {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 4px;
    margin-top: 2px;
}
.h2h-card-scorer-col { display: flex; flex-direction: column; gap: 1px; }
.h2h-card-scorer-col.away .h2h-card-scorer { color: #b87ef8; }
.h2h-card-scorer {
    font-size: 0.65rem;
    color: #7eb8ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── 가운데 패널 (H2H 요약 + 경기기록 flex row) ─────────── */
.center-panel {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
}
.match-record-col {
    padding: 4px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}
.match-record-row {
    border-radius: 6px;
    padding: 6px 8px;
    background: rgba(255,255,255,0.03);
    border-left: 3px solid transparent;
    display: flex;
    flex-direction: column;
    gap: 3px;
    transition: background 0.2s, border-left-color 0.2s;
    cursor: default;
}
.match-record-row:hover {
    background: rgba(77, 182, 255, 0.08);
}
.match-record-row.result-W { border-left-color: #4caf7a; }
.match-record-row.result-D { border-left-color: #e0a030; }
.match-record-row.result-L { border-left-color: #e05050; }
.match-record-row.result-W:hover { border-left-color: #7fff9f; }
.match-record-row.result-D:hover { border-left-color: #ffd060; }
.match-record-row.result-L:hover { border-left-color: #ff7070; }

/* 맞대결 비율 바 */
.record-ratio-wrap {
    margin-top: 14px;
}
.record-ratio-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    gap: 2px;
}
.rrb-w { background: #4db6ff; border-radius: 4px 0 0 4px; transition: width 0.6s ease; }
.rrb-d { background: #c0c0c0; transition: width 0.6s ease; }
.rrb-l { background: #ff8a65; border-radius: 0 4px 4px 0; transition: width 0.6s ease; }
.record-ratio-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0 2px;
}

.mr-meta {
    display: flex;
    align-items: center;
    gap: 5px;
}
.mr-date {
    font-size: 0.62rem;
    color: #5a7090;
}
.mr-venue {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
}
.mr-venue.home { background: #1a3a6a; color: #7eb8ff; }
.mr-venue.away { background: #2a1a3a; color: #b87ef8; }
.mr-venue-sm {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 3px;
    border-radius: 3px;
    margin-right: 2px;
}
.mr-venue-sm.home { background: #1a3a6a; color: #7eb8ff; }
.mr-venue-sm.away { background: #2a1a3a; color: #b87ef8; }

.mr-score {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
}
.mr-team {
    color: #c8d8f0;
    font-weight: 600;
    white-space: nowrap;
}
.mr-team.opp { color: #8aa0bb; font-weight: 400; }
.mr-num {
    color: #c8d8f0;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0 3px;
}

.mr-scorers {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 8px;
    margin-top: 1px;
}
.mr-scorer {
    font-size: 0.65rem;
    white-space: nowrap;
}
.mr-scorer.home { color: #7eb8ff; }
.mr-scorer.away { color: #b87ef8; }
.mr-scorer-note {
    font-size: 0.58rem;
    color: #4a6080;
    font-style: italic;
}

/* ── 팀 분석 모달 ──────────────────────────────────────────── */
.analytics-modal-content {
    width: 90vw;
    max-width: 900px;
    max-height: 88vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px 24px;
}
.analytics-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.analytics-header h2 {
    margin: 0;
    font-size: 1.1rem;
    color: #c8d8f0;
    flex: 1;
}
.analytics-team-select {
    background: #1a2540;
    color: #c8d8f0;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.85rem;
    cursor: pointer;
}
.analytics-tabs-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.analytics-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.year-filter-wrap {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}
.year-filter-btn {
    background: rgba(255,255,255,0.05);
    color: #7a8fa8;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 5px;
    padding: 3px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}
.year-filter-btn.active,
.year-filter-btn:hover {
    background: rgba(255,200,60,0.15);
    color: #ffd060;
    border-color: rgba(255,200,60,0.35);
}
.wr-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
}
.analytics-tab-btn {
    background: rgba(255,255,255,0.06);
    color: #8aa0bb;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 5px 14px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.analytics-tab-btn.active,
.analytics-tab-btn:hover {
    background: rgba(78,164,248,0.18);
    color: #7eb8ff;
    border-color: rgba(78,164,248,0.4);
}
.analytics-panel { display: flex; flex-direction: column; gap: 14px; }
.analytics-panel.hidden { display: none; }
.chart-wrap {
    width: 100%;
    height: 280px;
    position: relative;
}
.chart-wrap-sm { height: 180px; }
.analytics-section-label {
    margin: 4px 0 0;
    font-size: 0.78rem;
    color: #7eb8ff;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.chart-empty {
    color: #4a6080;
    font-size: 0.82rem;
    text-align: center;
    padding: 20px;
}
.analytics-table-wrap {
    overflow-x: auto;
}
.analytics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    color: #b0c4d8;
}
.analytics-table th {
    background: rgba(255,255,255,0.06);
    color: #7eb8ff;
    padding: 5px 8px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-weight: 600;
    white-space: nowrap;
}
.analytics-table td {
    padding: 4px 8px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.analytics-table tr:hover td { background: rgba(255,255,255,0.04); }

/* ── 예측 보고서 섹션 ──────────────────────────────────────── */
#prediction-section {
    position: relative;
    padding: 12px clamp(16px, 4vw, 48px) 20px;
    box-sizing: border-box;
}
#prediction-section.hidden { display: none; }
#prediction-close {
    position: absolute;
    top: 6px;
    right: 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: #667;
    border-radius: 6px;
    font-size: 0.85rem;
    padding: 3px 9px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    z-index: 1;
}
#prediction-close:hover { background: rgba(248,113,113,0.15); border-color: rgba(248,113,113,0.4); color: #f87171; }

.pred-loading {
    text-align: center;
    color: #4a6080;
    padding: 20px;
    font-size: 0.85rem;
}

.pred-grid {
    display: grid;
    grid-template-columns: 1fr 220px 1fr;
    gap: 12px;
    background: rgba(18,29,54,0.7);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 18px 16px;
}

/* 팀 패널 */
.pred-team-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pred-home { align-items: flex-start; }
.pred-away { align-items: flex-end; text-align: right; }

.pred-team-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #c8d8f0;
}
.pred-home .pred-team-name { color: #7eb8ff; }
.pred-away .pred-team-name { color: #b87ef8; }

/* 폼 배지 */
.pred-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.pred-away .pred-badges { justify-content: flex-end; }
.form-badge {
    width: 22px; height: 22px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.6rem; font-weight: 700;
}
.fb-w { background: rgba(123,237,159,0.2); color: #7bed9f; border: 1px solid rgba(123,237,159,0.4); }
.fb-d { background: rgba(160,160,160,0.15); color: #aaa; border: 1px solid rgba(160,160,160,0.3); }
.fb-l { background: rgba(248,113,113,0.2); color: #f87171; border: 1px solid rgba(248,113,113,0.4); }

/* 스탯 행 */
.pred-stats-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.pred-away .pred-stats-row { justify-content: flex-end; }
.pred-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 5px 10px;
    min-width: 52px;
}
.ps-val { font-size: 0.9rem; font-weight: 700; color: #c8d8f0; }
.ps-lbl { font-size: 0.58rem; color: #4a6a8a; margin-top: 1px; white-space: nowrap; }

/* 유의사항 */
.pred-notes { display: flex; flex-direction: column; gap: 4px; }
.pred-note {
    font-size: 0.72rem;
    color: #9ab0c8;
    background: rgba(255,255,255,0.03);
    border-left: 2px solid rgba(78,164,248,0.35);
    padding: 3px 7px;
    border-radius: 0 4px 4px 0;
}
.pred-away .pred-note {
    border-left: none;
    border-right: 2px solid rgba(184,126,248,0.35);
    border-radius: 4px 0 0 4px;
}
.pred-note-none { font-size: 0.7rem; color: #3a5070; font-style: italic; }

/* 득점 선수 */
.pred-scorers { display: flex; flex-direction: column; gap: 3px; }
.pred-scorers-title {
    font-size: 0.65rem;
    color: #4a6a8a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}
.pred-scorer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
}
.pred-away .pred-scorer-row { flex-direction: row-reverse; }
.scorer-name { color: #c0d0e0; }
.scorer-g { color: #7bed9f; font-weight: 700; font-size: 0.7rem; }


/* 중앙 패널 */
.pred-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 0 8px;
    border-left: 1px solid rgba(255,255,255,0.06);
    border-right: 1px solid rgba(255,255,255,0.06);
}
.pred-center-title {
    font-size: 0.7rem;
    color: #4a6a8a;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* 확률 바 */
.pred-prob-bar {
    width: 100%;
    height: 32px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
}
.ppb-home { background: linear-gradient(90deg, #2563a8, #4ea4f8); display:flex; align-items:center; justify-content:center; font-size:0.7rem; font-weight:700; color:#fff; min-width:28px; transition: width 0.6s ease; }
.ppb-draw { background: rgba(100,110,130,0.6); display:flex; align-items:center; justify-content:center; font-size:0.7rem; color:#bbb; min-width:22px; }
.ppb-away { background: linear-gradient(90deg, #b87ef8, #8a4ad8); display:flex; align-items:center; justify-content:center; font-size:0.7rem; font-weight:700; color:#fff; min-width:28px; transition: width 0.6s ease; }

.pred-prob-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 0.65rem;
    font-weight: 600;
}

/* 예측 매치 헤더 */
.pred-match-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(78,164,248,0.07);
    border: 1px solid rgba(78,164,248,0.15);
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 0.78rem;
    color: #7a9ab8;
}
.pmh-round { background: rgba(78,164,248,0.15); color: #4ea4f8; padding: 2px 7px; border-radius: 4px; font-weight: 700; font-size: 0.7rem; }
.pmh-date  { color: #c8d8f0; font-weight: 600; }
.pmh-venue { margin-left: auto; color: #4a6080; font-size: 0.72rem; }

/* 예상 스코어 */
.pred-score-est {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    padding: 8px 10px;
}
.pse-label { font-size: 0.63rem; color: #4a6a8a; text-transform: uppercase; letter-spacing: 0.05em; }
.pse-score { font-size: 1.4rem; font-weight: 700; color: #c8d8f0; letter-spacing: 2px; }

/* 핵심 매치업 */
.pred-matchup-keys {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    padding: 8px 10px;
}
.pmk-title { font-size: 0.63rem; color: #4a6a8a; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 5px; }
.pmk-item  { font-size: 0.72rem; color: #9ab; padding: 2px 0; }

/* 리그 탭 래퍼 */
#league-schedule-wrap {
    width: 100%;
    padding: 0 clamp(16px, 4vw, 48px);
    box-sizing: border-box;
}
#league-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}
.league-tab-btn {
    padding: 5px 16px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.12);
    background: #131c2e;
    color: #7a8fa8;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
}
.league-tab-btn.active {
    background: #1e3a5f;
    color: #4ea4f8;
    border-color: rgba(78,164,248,0.4);
}
.league-tab-panel { display: none; }
.league-tab-panel.active { display: block; }

/* K2/K1 일정 배너 래퍼 (탭 내부) */
#k2-schedule-banner-wrap,
#k1-schedule-banner-wrap {
    width: 100%;
    box-sizing: border-box;
}

/* K2/K1 일정 배너 */
.ksb-banner,
#k2-schedule-banner {
    background: linear-gradient(180deg, #0b1424 0%, #0e1830 100%);
    border: 1px solid rgba(78,164,248,0.12);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 10px;
}
.ksb-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
}
.ksb-title { font-size: 0.78rem; font-weight: 700; color: #4ea4f8; text-transform: uppercase; letter-spacing: 0.06em; }
.ksb-sub   { font-size: 0.68rem; color: #3a5060; }

/* 라운드 탭 */
.ksb-round-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}
.ksb-round-btn {
    position: relative;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: #5a7a8a;
    border-radius: 5px;
    font-size: 0.7rem;
    padding: 3px 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.ksb-round-btn:hover { background: rgba(78,164,248,0.1); color: #9ab; border-color: rgba(78,164,248,0.25); }
.ksb-round-btn.active { background: rgba(78,164,248,0.18); border-color: rgba(78,164,248,0.5); color: #4ea4f8; font-weight: 700; }
.ksb-round-done { font-size: 0.6rem; color: #3a5060; }
.ksb-round-btn.active .ksb-round-done { color: #4a7a9a; }
/* 즐겨찾기 매치 보유 라운드 — 우상단 ★ 인디케이터 */
.ksb-round-btn.ksb-round-fav::after {
    content: "★";
    position: absolute;
    top: -3px;
    right: -2px;
    font-size: 9px;
    line-height: 1;
    color: #fbbf24;
    text-shadow: 0 0 2px rgba(0,0,0,0.5);
    pointer-events: none;
}

/* 경기 목록 — 카드형 그리드 */
.ksb-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0 8px;
}

/* ── 경기 매치 카드 (kmc) ── */
.kmc {
    display: flex;
    align-items: stretch;
    width: calc(50% - 4px);
    min-width: 240px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-default);
    cursor: pointer;
    background: var(--bg-card);
    transition: transform var(--trans-fast), box-shadow var(--trans-fast), border-color var(--trans-fast);
}
.kmc:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.45);
    border-color: var(--border-subtle);
}
.kmc:active { transform: scale(0.98); }
.kmc.kmc-active {
    border-color: #7ecfff;
    box-shadow: 0 0 0 2px rgba(126,207,255,0.35), 0 4px 12px rgba(0,0,0,0.3);
    background: linear-gradient(180deg, rgba(126,207,255,0.06), transparent);
}
.kmc-upcoming { border-color: rgba(78,164,248,0.25); }
.kmc-done     { opacity: 0.92; }   /* 결과 카드 가독성 — 0.75는 과하게 흐렸음 (가장 많이 보는 카드) */
.kmc-done:hover { opacity: 1; }

.kmc-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    gap: 5px;
    min-width: 0;
}
.kmc-home { border-right: 1px solid rgba(255,255,255,0.06); }
.kmc-away { border-left:  1px solid rgba(255,255,255,0.06); }

.kmc-emb {
    width: 28px; height: 28px;
    object-fit: contain;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}
.kmc-name {
    font-size: 0.8rem;          /* 0.72→0.8 (12.8px, 최소 가독 크기 충족) */
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    white-space: nowrap;
}

.kmc-mid {
    flex: 0 0 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px;
    background: rgba(255,255,255,0.05);   /* 0.02→0.05 스코어 컬럼 초점 분리 강화 */
}
.kmc-score {
    font-size: 1.2rem;          /* 1→1.2 카드 핵심 초점 강조 */
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: 1px;
}
.kmc-score-sep { color: var(--text-muted); font-weight: 400; margin: 0 2px; }
.kmc-time {
    font-size: 0.8rem;
    font-weight: 700;
    color: #4ea4f8;
}
.kmc-meta {
    font-size: 0.7rem;          /* 0.62→0.7 날짜 가독성 */
    color: var(--text-secondary);   /* muted→secondary 대비 ↑ */
}
.kmc-tag {
    font-size: 0.66rem;         /* 0.6→0.66 라벨 가독성 */
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    letter-spacing: 0.3px;
    margin-top: 2px;
}
.kmc-tag-pred { background: rgba(78,164,248,0.18); color: #4ea4f8; }
.kmc-tag-done { background: rgba(255,255,255,0.07); color: var(--text-muted); }

@media (max-width: 640px) {
    .kmc { width: 100%; }
}

/* ── 라운드 사전 예측 패널 (look-ahead bias 차단된 R(N-1)까지의 데이터) ── */
.ksb-pred-panel:empty { display: none; }
.ksb-pred-panel {
    margin: 6px 0 10px;
    padding: 10px 12px 8px;
    background: rgba(20,30,50,0.5);
    border: 1px solid rgba(78,164,248,0.18);
    border-radius: 8px;
}
.rpp-loading,
.rpp-empty {
    color: #5a7a8a; font-size: 0.72rem; text-align: center; padding: 6px 0;
}
.rpp-head {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px;
    margin-bottom: 8px; padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.rpp-title { font-weight: 700; color: #c8d8f0; font-size: 0.78rem; }
.rpp-cutoff { color: #7e98ad; font-size: 0.7rem; margin-left: auto; }   /* 대비·크기 ↑ */

.rpp-table {
    width: 100%; border-collapse: collapse; font-size: 0.76rem;   /* 0.7→0.76 (12px↑) */
}
.rpp-table thead th {
    color: #8aa0bb; font-weight: 600; padding: 4px 6px;   /* 헤더 대비 ↑ (#5a7a8a→#8aa0bb) */
    text-align: center; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.rpp-table thead th:first-child { text-align: left; }
.rpp-table tbody td { padding: 5px 6px; text-align: center; }
.rpp-table tbody tr { border-bottom: 1px solid rgba(255,255,255,0.03); }
.rpp-table tbody tr:hover { background: rgba(78,164,248,0.04); }

.rpp-mu {
    text-align: left !important; color: #c8d8f0; font-weight: 600;
    white-space: nowrap;
}
.rpp-mu > * { display: inline-block; vertical-align: middle; }
.rpp-h { color: #4ea4f8; width: 56px; text-align: right; }
.rpp-a { color: #b87ef8; width: 56px; text-align: left; }
.rpp-vs { color: #7e98ad; font-size: 0.66rem; width: 22px; text-align: center; }

.rpp-pct { color: #a3bcd6; font-variant-numeric: tabular-nums; }   /* 예측 % 가독성 — #6a8aa8→#a3bcd6 */
.rpp-pick { color: #facc15; font-weight: 900; }

.rpp-ts { color: #c8d8f0; font-weight: 600; font-variant-numeric: tabular-nums; }
.rpp-actual { color: #c8d8f0; font-weight: 700; font-variant-numeric: tabular-nums; }
.rpp-actual-tbd { color: #5a7a8a; font-weight: 400; font-style: italic; }

.rpp-hit-ok { color: #4ade80; font-weight: 900; }
.rpp-hit-no { color: #f87171; font-weight: 700; }
.rpp-hit-na { color: #5a7a8a; }

@media (max-width: 640px) {
    .rpp-cutoff { width: 100%; margin-left: 0; }
    .rpp-table { font-size: 0.65rem; }
}
.ksb-item  {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 7px;
    padding: 7px 12px;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    font-size: 0.75rem;
}
.ksb-item:hover         { background: rgba(78,164,248,0.08); border-color: rgba(78,164,248,0.25); }
.ksb-item-done          { opacity: 0.7; }
.ksb-item-done:hover    { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); }
.ksb-item-upcoming      { border-color: rgba(78,164,248,0.2); }
.ksb-date  { color: #5a7a8a; white-space: nowrap; font-size: 0.7rem; min-width: 36px; }
.ksb-match { display: flex; align-items: center; gap: 8px; flex: 1; }
.ksb-team  { font-weight: 600; color: #c8d8f0; min-width: 48px; }
.ksb-home  { text-align: right; }
.ksb-away  { text-align: left; }
.ksb-vs    { color: #3a5060; font-size: 0.65rem; }
.ksb-score { color: #e8f0fc; font-weight: 700; font-size: 0.85rem; min-width: 40px; text-align: center; }
.ksb-time  { color: #4a6a8a; font-size: 0.72rem; min-width: 40px; text-align: center; }
.ksb-venue { color: #3a5060; font-size: 0.67rem; margin-left: auto; }
.ksb-pred-hint { color: #4ea4f8; font-size: 0.65rem; white-space: nowrap; }

/* H2H */
.pred-h2h {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    padding: 8px 10px;
    text-align: center;
}
.pred-h2h-title {
    font-size: 0.63rem;
    color: #4a6a8a;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.pred-h2h-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 700;
}
.h2h-sep { font-size: 0.65rem; color: #4a6a8a; }
.pred-h2h-draw { font-size: 0.7rem; color: #888; margin-top: 3px; }

/* ══════════════════════════════════════════════════════
   예측 엔진 v2 — 신뢰도·히트맵·TOP5·부상·트렌드·타이밍
══════════════════════════════════════════════════════ */

/* 백테스트 정확도 배너 */
.pred-backtest {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    background: linear-gradient(90deg, rgba(78,164,248,0.08), rgba(184,126,248,0.08));
    border: 1px solid rgba(78,164,248,0.25);
    border-radius: 8px;
    padding: 8px 14px;
    margin-bottom: 12px;
    font-size: 0.72rem;
}
.pbt-label {
    font-weight: 700;
    color: #8ab0d8;
    font-size: 0.72rem;
}
.pbt-stat {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}
.pbt-v {
    font-weight: 700;
    color: #facc15;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}
.pbt-k {
    color: #6a8aa8;
    font-size: 0.62rem;
}
.pbt-sub {
    margin-left: auto;
    color: #6a8aa8;
    font-size: 0.62rem;
}

/* 라운드별 적중률 차트 */
.pred-backtest-chart {
    width: 100%;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* Backtest 빗나간 매치 5건 (잔차) */
.pbt-worst {
    width: 100%;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 0.68rem;
}
.pbt-worst summary {
    cursor: pointer;
    color: #aab8d4;
    font-weight: 600;
    list-style: none;
    user-select: none;
    padding: 4px 0;
}
.pbt-worst summary::-webkit-details-marker { display: none; }
.pbt-worst summary::before { content: "▸ "; color: #6a8aa8; }
.pbt-worst[open] summary::before { content: "▾ "; }
.pbt-worst-list {
    display: flex; flex-direction: column; gap: 4px;
    padding-top: 6px;
}
.pbt-worst-row {
    display: grid;
    grid-template-columns: 38px 1fr auto auto auto auto auto;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 4px;
    background: rgba(255,255,255,0.03);
}
.pbt-worst-row:hover { background: rgba(255,255,255,0.06); }
.pbt-worst-date  { color: #6a8aa8; font-variant-numeric: tabular-nums; }
.pbt-worst-match { color: #e3eaff; font-weight: 600; }
.pbt-worst-pred  { color: #94a3b8; }
.pbt-worst-arrow { color: #4a6a88; }
.pbt-worst-actual { color: #f87171; font-weight: 600; }
.pbt-worst-conf  { font-weight: 600; }
.pbt-worst-brier { color: #6a8aa8; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
    .pbt-worst-row { grid-template-columns: 1fr auto; }
    .pbt-worst-pred, .pbt-worst-arrow, .pbt-worst-actual, .pbt-worst-conf, .pbt-worst-brier { display: none; }
}
.pbc-svg {
    display: block;
    width: 100%;
    max-width: 440px;
    height: auto;
}
.pbc-legend {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    font-size: 0.6rem;
    color: #8ab0d8;
}
.pbc-lg {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.pbc-lg-bar {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 2px;
    opacity: 0.85;
}
.pbc-lg-line {
    display: inline-block;
    width: 14px;
    height: 2px;
    border-radius: 1px;
}
.pbc-lg-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* 신뢰도 배지 */
.pred-confidence {
    display: flex; align-items: center; gap: 6px;
    flex-wrap: wrap; justify-content: center;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 6px 10px;
    margin-bottom: 8px;
    font-size: 0.72rem;
}
.pc-icon { font-size: 0.8rem; }
.pc-label { font-weight: 700; font-size: 0.72rem; }
.pc-actual { font-weight: 600; font-size: 0.66rem; letter-spacing: -0.01em; }
.pc-sub   { color: #6a8aa8; font-size: 0.65rem; }

/* K1 예측 불확실 경고 */
.pred-uncertainty-warn {
    display: flex; align-items: center; gap: 6px;
    border: 1px solid;
    border-radius: 7px;
    padding: 5px 10px;
    margin-bottom: 8px;
    font-size: 0.7rem;
}
.puw-icon { font-size: 0.8rem; flex-shrink: 0; }
.puw-text { color: #e2c97e; font-weight: 600; line-height: 1.3; }
.pred-prob-bar--uncertain {
    opacity: 0.45;
    filter: grayscale(0.4);
}
.pred-center--uncertain .pred-score-est {
    opacity: 0.45;
}

/* 확장 분석 섹션 */
.pred-extras {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pred-extras-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* 스코어 매트릭스 히트맵 */
.pred-score-matrix {
    position: relative;
    background: rgba(18,29,54,0.7);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 12px 14px 10px;
}
.psm-title {
    font-size: 0.72rem;
    color: #8ab0d8;
    text-align: center;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.psm-axis-label {
    position: absolute;
    font-size: 0.58rem;
    color: #6a8aa8;
}
.psm-axis-away { top: 30px; right: 14px; }
.psm-axis-home { bottom: 10px; left: 14px; }
.psm-grid {
    display: grid;
    gap: 2px;
}
.psm-cell {
    padding: 5px 2px;
    text-align: center;
    font-size: 0.64rem;
    border-radius: 3px;
    color: #e8f2ff;
    min-width: 0;
}
.psm-corner { background: transparent; }
.psm-head {
    background: rgba(255,255,255,0.04);
    color: #8ab0d8;
    font-weight: 700;
    font-size: 0.62rem;
}
.psm-val { font-variant-numeric: tabular-nums; }
.psm-top {
    outline: 1.5px solid #facc15;
    font-weight: 700;
    color: #fff;
}

/* 상위 스코어 TOP5 */
.pred-top-scores {
    background: rgba(18,29,54,0.7);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 12px 14px;
}
.pts-title {
    font-size: 0.72rem;
    color: #8ab0d8;
    text-align: center;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.pts-list { display: flex; flex-direction: column; gap: 6px; }
.pts-row {
    display: grid;
    grid-template-columns: 18px 50px 1fr 46px;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
}
.pts-rank {
    color: #6a8aa8;
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.pts-score {
    font-weight: 700;
    font-size: 0.9rem;
    text-align: center;
    color: #e8f2ff;
    font-variant-numeric: tabular-nums;
}
.pts-h { color: #7eb8ff; }
.pts-a { color: #c79ef8; }
.pts-bar-wrap {
    background: rgba(255,255,255,0.05);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}
.pts-bar {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #4ea4f8, #b87ef8);
    border-radius: 4px;
}
.pts-pct {
    color: #c8d8f0;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.pts-best .pts-score { color: #facc15; }


/* 폼 트렌드 */
.pred-trend-block {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    padding: 6px 8px;
}
.ptb-head {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    color: #8ab0d8;
    margin-bottom: 3px;
}
.ptb-pct {
    color: #c8d8f0;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.pred-trend-svg {
    display: block;
    width: 100%;
    height: 36px;
}


/* 예상 라인업 카드 */
.pred-lineup {
    background: rgba(18,29,54,0.7);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 12px 14px;
}
.pred-lineup-home { border-left: 3px solid #4ea4f8; }
.pred-lineup-away { border-left: 3px solid #b87ef8; }
.lu-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.lu-label { font-size: 0.72rem; color: #8ab0d8; font-weight: 700; }
.lu-formation {
    background: rgba(250,204,21,0.15);
    color: #facc15;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
}
.lu-section { margin-bottom: 6px; }
.lu-section-title {
    font-size: 0.55rem;
    color: #6a8aa8;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 2px;
}
.lu-player {
    display: grid;
    grid-template-columns: 22px 28px 1fr 32px;
    align-items: center;
    gap: 6px;
    padding: 3px 4px;
    font-size: 0.72rem;
    border-radius: 4px;
}
.lu-player:hover { background: rgba(255,255,255,0.03); }
.lu-pos {
    text-align: center;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 3px;
    padding: 1px 0;
}
.lu-num {
    color: #6a8aa8;
    font-variant-numeric: tabular-nums;
    text-align: right;
    font-size: 0.65rem;
}
.lu-name { color: #e8f2ff; font-weight: 500; }
.lu-name.scorer-link { cursor: pointer; }
.lu-name.scorer-link:hover { color: #4ea4f8; text-decoration: underline; }
.lu-player-unavail { opacity: 0.55; }
.lu-player-unavail .lu-name { text-decoration: line-through; color: #8aa0bb; }
.lu-status-badge {
    font-size: 0.7rem;
    cursor: help;
    flex-shrink: 0;
}
.lu-rating {
    text-align: right;
    color: #facc15;
    font-variant-numeric: tabular-nums;
    font-size: 0.68rem;
    font-weight: 600;
}
.lu-based {
    margin-top: 6px;
    font-size: 0.6rem;
    color: #6a8aa8;
    text-align: right;
}

/* ── 예측 → 전술판 진입 CTA 버튼 (P6 UI 슈퍼파워) ────────── */
.pred-lineup-cta {
    display: flex;
    justify-content: center;
    margin: 4px 0 8px;
}
.pred-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 22px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #fff;
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 55%, #ec4899 100%);
    background-size: 200% 100%;
    background-position: 0% 50%;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255,255,255,0.18);
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out,
                filter 0.2s, background-position 0.4s ease-out;
}
.pred-cta-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5), inset 0 1px 0 rgba(255,255,255,0.22);
    filter: brightness(1.08);
    background-position: 100% 50%;
}
.pred-cta-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.pred-cta-btn:focus-visible {
    outline: 3px solid rgba(167, 198, 255, 0.85);
    outline-offset: 2px;
}
.pred-cta-btn:disabled {
    opacity: 0.6;
    cursor: progress;
    transform: none;
    filter: none;
}
.pred-cta-btn.loading .pred-cta-icon {
    animation: pred-cta-spin 0.9s linear infinite;
}
.pred-cta-btn.success {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.45);
}
.pred-cta-btn.error {
    background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.45);
    animation: pred-cta-shake 0.45s ease-out;
}
.pred-cta-icon {
    display: inline-block;
    font-size: 1.05rem;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}
.pred-cta-text {
    white-space: nowrap;
}
.pred-cta-hint {
    font-size: 0.68rem;
    font-weight: 500;
    opacity: 0.85;
    padding-left: 10px;
    margin-left: 2px;
    border-left: 1px solid rgba(255, 255, 255, 0.35);
    white-space: nowrap;
}
@keyframes pred-cta-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes pred-cta-shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-4px); }
    75%      { transform: translateX(4px); }
}
@media (max-width: 700px) {
    .pred-cta-btn { padding: 10px 16px; font-size: 0.8rem; gap: 8px; }
    .pred-cta-hint { display: none; }
}

/* 휴식일 + 심판 정보 카드 */
/* 스타일 + 카드 2-col 그리드 */
.pred-style-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.pred-style-cards-grid:empty { display: none; }
@media (max-width: 700px) {
    .pred-style-cards-grid { grid-template-columns: 1fr; }
}

/* 세트피스 매치업 카드 */
.pred-setpiece {
    background: rgba(18,29,54,0.7);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 12px 14px;
    grid-column: 1 / -1;
}
.sp-title {
    font-size: 0.75rem;
    color: #facc15;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
    letter-spacing: 0.03em;
}
.sp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.sp-team {
    padding: 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
}
.sp-home { border-left: 3px solid #4ea4f8; }
.sp-away { border-left: 3px solid #b87ef8; }
.sp-team-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: #e8f2ff;
    margin-bottom: 8px;
}
.sp-home .sp-team-name { color: #7eb8ff; }
.sp-away .sp-team-name { color: #c79ef8; }
.sp-stat {
    margin-bottom: 6px;
}
.sp-stat-bar {
    position: relative;
    height: 14px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 2px;
}
.sp-stat-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}
.sp-off { background: linear-gradient(90deg, #7bed9f, #4ea4f8); }
.sp-def { background: linear-gradient(90deg, #fbbf24, #f87171); }
.sp-stat-val {
    position: absolute;
    right: 6px;
    top: 0;
    line-height: 14px;
    font-size: 0.62rem;
    font-weight: 700;
    color: #e8f2ff;
    font-variant-numeric: tabular-nums;
}
.sp-stat-lbl {
    font-size: 0.6rem;
    color: #8ab0d8;
}
.sp-stat-sub {
    color: #6a8aa8;
    font-size: 0.56rem;
}
.sp-split {
    margin-top: 8px;
    display: flex;
    gap: 6px;
    justify-content: flex-start;
}
.sp-tag {
    font-size: 0.58rem;
    background: rgba(255,255,255,0.05);
    color: #c8d8f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-variant-numeric: tabular-nums;
}
.sp-pk  { border: 1px solid rgba(250,204,21,0.3); color: #facc15; }
.sp-fk  { border: 1px solid rgba(123,237,159,0.3); color: #7bed9f; }
.sp-insights {
    margin-top: 10px;
    padding: 8px 10px;
    background: rgba(250,204,21,0.06);
    border: 1px solid rgba(250,204,21,0.2);
    border-radius: 6px;
}
.sp-insight {
    font-size: 0.68rem;
    color: #facc15;
    font-weight: 600;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .sp-grid { grid-template-columns: 1fr; }
}

/* ── 세트피스 효율 카드 (P6 UI 슈퍼파워, shotmap 기반) ───────── */
.pred-setpiece-eff {
    background: rgba(18,29,54,0.7);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 14px 16px;
    grid-column: 1 / -1;
    margin-top: 4px;
}
.spe-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.spe-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #facc15;
    letter-spacing: -0.01em;
}
.spe-sub { font-size: 0.62rem; color: #6a8aa8; font-weight: 500; }
.spe-xg-badge {
    position: relative;
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 0.58rem;
    font-weight: 700;
    color: #fde68a;
    background: rgba(250, 204, 21, 0.14);
    border: 1px solid rgba(250, 204, 21, 0.4);
    border-radius: 6px;
    vertical-align: middle;
    letter-spacing: 0.01em;
    cursor: help;
}
.spe-tip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 11px;
    height: 11px;
    font-size: 0.52rem;
    font-style: normal;
    background: rgba(250, 204, 21, 0.25);
    border-radius: 50%;
    margin-left: 3px;
    vertical-align: middle;
    line-height: 1;
}
.spe-xg-badge[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    padding: 8px 10px;
    background: #1a2940;
    color: #c8ddf0;
    font-size: 0.68rem;
    font-weight: 400;
    line-height: 1.5;
    border: 1px solid rgba(250, 204, 21, 0.3);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    white-space: normal;
    text-align: left;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, visibility 0.18s ease;
    z-index: 200;
    letter-spacing: 0;
}
.spe-xg-badge[data-tip]::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 1px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(250, 204, 21, 0.3);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, visibility 0.18s ease;
    z-index: 200;
}
.spe-xg-badge[data-tip]:hover::after,
.spe-xg-badge[data-tip]:hover::before,
.spe-xg-badge[data-tip]:focus::after,
.spe-xg-badge[data-tip]:focus::before {
    opacity: 1;
    visibility: visible;
}
.spe-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 4px;
}
.spe-team {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}
.spe-team-home { text-align: right; }
.spe-team-away { text-align: left; }
.spe-team-divider {
    font-size: 0.55rem;
    color: #6a8aa8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.spe-row {
    padding: 10px 0;
    border-top: 1px solid rgba(255,255,255,0.04);
}
.spe-row:first-of-type { border-top: 0; padding-top: 6px; }
.spe-row-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.spe-row-icon { font-size: 1rem; line-height: 1; }
.spe-row-lbl { font-size: 0.74rem; font-weight: 700; color: #e8f2ff; letter-spacing: -0.005em; }
.spe-row-avg { margin-left: auto; font-size: 0.62rem; color: #facc15; opacity: 0.78; }
.spe-row-bars {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: center;
}
.spe-side { display: grid; gap: 5px; }
.spe-stats {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 10px;
    font-variant-numeric: tabular-nums;
    font-size: 0.72rem;
}
.spe-stats-r { justify-content: flex-start; }
.spe-shots, .spe-goals { color: #e8f2ff; font-weight: 700; }
.spe-shots small, .spe-goals small {
    font-size: 0.55rem;
    font-weight: 500;
    color: #6a8aa8;
    margin-left: 2px;
}
.spe-conv {
    color: #facc15;
    font-weight: 800;
    font-size: 0.78rem;
}
.spe-xg {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: -0.01em;
}
.spe-xg-up   { background: rgba(34,197,94,0.18); color: #7bed9f; }
.spe-xg-down { background: rgba(239,68,68,0.18); color: #f87171; }
.spe-xg-flat { background: rgba(255,255,255,0.05); color: #aab; }
.spe-bar-wrap {
    position: relative;
    height: 12px;
    background: rgba(255,255,255,0.04);
    border-radius: 3px;
    overflow: visible;
}
.spe-bar {
    position: absolute;
    right: 0;
    top: 2px; bottom: 2px;
    width: var(--w, 0);
    background: var(--c, #4ea4f8);
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.18);
    animation: spe-bar-grow 0.7s cubic-bezier(0.2, 0.8, 0.25, 1) both;
}
.spe-bar-r { left: 0; right: auto; }
@keyframes spe-bar-grow {
    from { width: 0; }
    to   { width: var(--w, 0); }
}
.spe-avg-line {
    position: absolute;
    top: -3px; bottom: -3px;
    width: 2px;
    background: #facc15;
    opacity: 0.7;
    border-radius: 1px;
    pointer-events: none;
}
.spe-insights {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.spe-insight {
    font-size: 0.72rem;
    color: #c8d8f0;
    padding: 5px 9px;
    background: rgba(96,165,250,0.06);
    border-left: 2px solid rgba(96,165,250,0.55);
    border-radius: 3px;
    line-height: 1.45;
}
.spe-contributors {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.spe-contrib-title {
    font-size: 0.62rem;
    color: #6a8aa8;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.spe-contrib-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
}
.spe-contrib-col { display: flex; flex-direction: column; gap: 3px; }
.spe-contrib-away { text-align: right; }
.spe-contrib-row {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 2px 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
    min-width: 0;
}
.spe-contrib-away.spe-contrib-col .spe-contrib-row {
    flex-direction: row-reverse;
}
.spe-contrib-row:hover { background: rgba(255,255,255,0.05); }
.spe-contrib-name {
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}
.spe-contrib-sits {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}
.spe-contrib-sit {
    font-size: 0.65rem;
    cursor: default;
}
.spe-contrib-sit b { font-size: 0.7rem; font-weight: 700; margin-left: 1px; }
.spe-contrib-goals {
    font-size: 0.65rem;
    font-weight: 700;
    color: #facc15;
    flex-shrink: 0;
    min-width: 18px;
    text-align: right;
}
.spe-contrib-away.spe-contrib-col .spe-contrib-goals { text-align: left; }
.spe-foot {
    margin-top: 8px;
    font-size: 0.58rem;
    color: #6a8aa8;
    text-align: right;
    font-style: italic;
}
@media (max-width: 700px) {
    .spe-row-head { flex-wrap: wrap; }
    .spe-row-avg { width: 100%; margin-left: 26px; margin-top: 2px; }
    .spe-stats { gap: 6px; font-size: 0.66rem; }
    .spe-conv { font-size: 0.7rem; }
    .spe-xg { padding: 1px 4px; font-size: 0.58rem; }
    .spe-team { font-size: 0.78rem; }
}

/* 카드 추세 (옐로/레드) — sp-* 패턴 재사용 변형 */
.pred-cards {
    background: rgba(18,29,54,0.7);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 12px 14px;
    grid-column: 1 / -1;
}
.cd-title {
    font-size: 0.75rem;
    color: #facc15;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
    letter-spacing: 0.03em;
}
.cd-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.cd-team {
    padding: 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
}
.cd-home { border-left: 3px solid #4ea4f8; }
.cd-away { border-left: 3px solid #b87ef8; }
.cd-team-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: #e8f2ff;
    margin-bottom: 8px;
}
.cd-home .cd-team-name { color: #7eb8ff; }
.cd-away .cd-team-name { color: #c79ef8; }
.cd-stat { margin-bottom: 6px; }
.cd-stat-bar {
    position: relative;
    height: 14px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 2px;
}
.cd-stat-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}
.cd-yellow { background: linear-gradient(90deg, #fbbf24, #facc15); }
.cd-stat-val {
    position: absolute;
    right: 6px;
    top: 0;
    line-height: 14px;
    font-size: 0.62rem;
    font-weight: 700;
    color: #e8f2ff;
    font-variant-numeric: tabular-nums;
}
.cd-stat-lbl {
    font-size: 0.6rem;
    color: #8ab0d8;
}
.cd-stat-sub {
    color: #6a8aa8;
    font-size: 0.56rem;
}
.cd-split {
    margin-top: 8px;
    display: flex;
    gap: 6px;
    justify-content: flex-start;
}
.cd-tag {
    font-size: 0.62rem;
    background: rgba(255,255,255,0.05);
    color: #c8d8f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-variant-numeric: tabular-nums;
}
.cd-y { border: 1px solid rgba(250,204,21,0.3); color: #facc15; }
.cd-r { border: 1px solid rgba(248,113,113,0.3); color: #f87171; }
.cd-insights {
    margin-top: 10px;
    padding: 8px 10px;
    background: rgba(248,113,113,0.06);
    border: 1px solid rgba(248,113,113,0.2);
    border-radius: 6px;
}
.cd-insight {
    font-size: 0.68rem;
    color: #fca5a5;
    font-weight: 600;
    line-height: 1.5;
}
@media (max-width: 768px) {
    .cd-grid { grid-template-columns: 1fr; }
}

/* 팀 스타일 매치업 (빌드업/경합/돌파) */
.pred-style {
    background: rgba(18,29,54,0.7);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 12px 14px;
    grid-column: 1 / -1;
}
.ts-title {
    font-size: 0.75rem;
    color: #facc15;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
    letter-spacing: 0.03em;
}
.ts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.ts-team {
    padding: 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
}
.ts-home { border-left: 3px solid #4ea4f8; }
.ts-away { border-left: 3px solid #b87ef8; }
.ts-team-name {
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.ts-home .ts-team-name { color: #7eb8ff; }
.ts-away .ts-team-name { color: #c79ef8; }
/* 리그 대비 상위 능력 배지 (동일지표 맞대결 대체) */
.ts-strength {
    display: flex; align-items: center; gap: 7px;
    padding: 5px 8px; margin-bottom: 5px;
    background: rgba(255,255,255,0.03); border-radius: 6px;
    border-left: 2px solid rgba(255,255,255,0.12);
}
.ts-strength:last-child { margin-bottom: 0; }
.ts-strength-top { background: rgba(123,237,159,0.10); border-left-color: #7bed9f; }
.ts-st-ic  { font-size: 0.85rem; flex-shrink: 0; }
.ts-st-lbl { font-size: 0.74rem; color: #c8d8f0; font-weight: 600; flex: 1; white-space: nowrap; }
.ts-st-rank {
    font-size: 0.66rem; font-weight: 700; color: #8ab0d8;
    background: rgba(138,176,216,0.12); padding: 1px 7px; border-radius: 8px; white-space: nowrap;
}
.ts-strength-top .ts-st-rank { color: #7bed9f; background: rgba(123,237,159,0.16); }
.ts-st-val { font-size: 0.72rem; color: #e8f2ff; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }
.ts-strength-none { font-size: 0.7rem; color: #8aa0bb; font-style: italic; padding: 6px 4px; }
.ts-section {
    margin-bottom: 10px;
}
.ts-section:last-child { margin-bottom: 0; }
.ts-section-lbl {
    font-size: 0.65rem;
    color: #8ab0d8;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: 0.02em;
}
.ts-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
}
.ts-row-lbl {
    flex-shrink: 0;
    width: 70px;
    font-size: 0.6rem;
    color: #c8d8f0;
}
.ts-row-sub {
    font-size: 0.56rem;
    color: #6a8aa8;
    margin-left: 76px;
    margin-bottom: 4px;
}
.ts-bar {
    position: relative;
    flex: 1;
    height: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 3px;
    overflow: hidden;
}
.ts-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}
.ts-build   { background: linear-gradient(90deg, #4ea4f8, #7bed9f); }
.ts-duel    { background: linear-gradient(90deg, #fbbf24, #f87171); }
.ts-aerial  { background: linear-gradient(90deg, #c79ef8, #b87ef8); }
.ts-dribble { background: linear-gradient(90deg, #7bed9f, #4ea4f8); }
.ts-bar-val {
    position: absolute;
    right: 5px;
    top: 0;
    line-height: 12px;
    font-size: 0.58rem;
    font-weight: 700;
    color: #e8f2ff;
    font-variant-numeric: tabular-nums;
}
.ts-insights {
    margin-top: 10px;
    padding: 8px 10px;
    background: rgba(78,164,248,0.06);
    border: 1px solid rgba(78,164,248,0.2);
    border-radius: 6px;
}
.ts-insight {
    font-size: 0.68rem;
    color: #7eb8ff;
    font-weight: 600;
    line-height: 1.5;
}
@media (max-width: 768px) {
    .ts-grid { grid-template-columns: 1fr; }
}

/* 골 타이밍 바 */
.pred-timing {
    background: rgba(18,29,54,0.7);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 10px 14px;
}
.ptm-head {
    font-size: 0.72rem;
    color: #8ab0d8;
    text-align: center;
    margin-bottom: 8px;
    font-weight: 700;
}
.ptm-sub { color: #6a8aa8; font-size: 0.6rem; font-weight: 400; margin-left: 4px; }
/* 골 타이밍 15분 구간 히트맵 */
.ptm-table {
    width: 100%; border-collapse: collapse;
    font-size: 0.7rem; font-variant-numeric: tabular-nums;
}
.ptm-table th {
    color: #8aa0bb; font-weight: 600; font-size: 0.62rem;
    padding: 2px 0 4px; text-align: center;
}
.ptm-corner { width: 38px; }
.ptm-tot, .ptm-totv { width: 26px; }
.ptm-rlbl {
    width: 38px; text-align: left; font-size: 0.66rem; font-weight: 700;
    padding-right: 4px; white-space: nowrap;
}
.ptm-rlbl-f { color: #7eb8ff; }
.ptm-rlbl-a { color: #ff9a9a; }
.ptm-cell {
    text-align: center; padding: 5px 0; font-weight: 600;
    color: #e8f2ff; border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.04);
}
.ptm-totv { text-align: center; color: #c8d8f0; font-weight: 800; padding-left: 4px; }

/* 예상 스코어 λ 라벨 강조 */
.pse-label { font-size: 0.68rem; color: #6a8aa8; }
.pse-score { font-weight: 700; }

/* ── 모바일 (≤ 768px) 1열 스택 ───────────────────────── */
@media (max-width: 768px) {
    .pred-grid {
        grid-template-columns: 1fr;
        padding: 14px 12px;
        gap: 14px;
    }
    .pred-team-panel.pred-away {
        align-items: flex-start;
        text-align: left;
    }
    .pred-away .pred-badges { justify-content: flex-start; }
    .pred-extras-row {
        grid-template-columns: 1fr;
    }
    .psm-cell {
        padding: 4px 1px;
        font-size: 0.56rem;
    }
    .pts-row {
        grid-template-columns: 16px 44px 1fr 40px;
        font-size: 0.7rem;
    }
}

/* ══════════════════════════════════════════════════════
   선수 분석 모달 (Player Analytics)
══════════════════════════════════════════════════════ */
.pa-modal { position: fixed; inset: 0; z-index: 8000; display: flex; align-items: center; justify-content: center; }
.pa-modal.hidden { display: none; }
.pa-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.65); }
.pa-modal-body {
    position: relative;
    background: linear-gradient(160deg, #0d1530 0%, #111827 100%);
    border: 1px solid rgba(78,164,248,0.2);
    border-radius: 14px;
    width: min(1200px, 96vw);
    max-height: 88vh;
    overflow-y: auto;
    padding: 24px 28px;
    box-shadow: 0 8px 48px rgba(0,0,0,0.7);
}
.pa-close {
    position: absolute; top: 14px; right: 16px;
    background: none; border: none; color: #667; font-size: 1.5rem;
    cursor: pointer; line-height: 1;
}
.pa-close:hover { color: #aac; }
.pa-loading { text-align: center; color: #4a6080; padding: 40px; font-size: 0.9rem; }

/* 헤더 */
.pa-header { margin-bottom: 16px; }
.pa-name-area { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pa-pos-badge {
    background: rgba(78,164,248,0.15); border: 1px solid rgba(78,164,248,0.35);
    color: #4ea4f8; border-radius: 5px; font-size: 0.72rem; padding: 2px 7px; font-weight: 700;
}
.pa-player-name { font-size: 1.35rem; font-weight: 700; color: #e8f0fc; }
.pa-team-name   { font-size: 0.82rem; color: #5a7a9a; }

/* 스탯 pills */
.pa-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pa-pill {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    color: #9ab; border-radius: 20px; font-size: 0.75rem; padding: 3px 10px;
}
.pa-pill-games  { color: #c8d8f0; }
.pa-pill-goals  { background: rgba(78,164,248,0.12); border-color: rgba(78,164,248,0.3); color: #4ea4f8; }
.pa-pill-assists{ background: rgba(124,184,248,0.1);  border-color: rgba(124,184,248,0.3); color: #7cb8f8; }
.pa-pill-rating { background: rgba(251,191,36,0.12);  border-color: rgba(251,191,36,0.3);  color: #fbbf24; }
.pa-pill-yellow { background: rgba(251,191,36,0.1); }
.pa-pill-red    { background: rgba(248,113,113,0.1); }

/* 년도 필터 */
.pa-year-filter { display: flex; flex-wrap: wrap; gap: 5px; }
.pa-year-btn {
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    color: #778; border-radius: 5px; font-size: 0.72rem; padding: 3px 9px; cursor: pointer;
}
.pa-year-btn:hover { color: #aac; border-color: rgba(78,164,248,0.4); }
.pa-year-btn.active { background: rgba(78,164,248,0.15); border-color: rgba(78,164,248,0.5); color: #4ea4f8; }

/* 차트 행 */
.pa-charts-row { display: grid; grid-template-columns: 260px 1fr; gap: 24px; margin-bottom: 16px; }
.pa-section-title { font-size: 0.72rem; color: #4a6a8a; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.pa-sub { text-transform: none; font-size: 0.68rem; color: #3a5060; }

/* 레이더 */
.pa-radar-wrap { display: flex; flex-direction: column; }
#chart-pa-radar { max-width: 240px; max-height: 240px; }

/* 폼 테이블 */
.pa-form-wrap { overflow-x: auto; }
.pa-table {
    width: 100%; border-collapse: collapse; font-size: 0.78rem; color: #9ab;
}
.pa-table th {
    color: #4a6a8a; font-weight: 600; text-align: left;
    padding: 4px 8px; border-bottom: 1px solid rgba(255,255,255,0.06);
    white-space: nowrap;
}
.pa-table td {
    padding: 5px 8px; border-bottom: 1px solid rgba(255,255,255,0.04);
    white-space: nowrap;
}
.pa-table tr:hover td { background: rgba(78,164,248,0.05); }
.pa-ha { font-size: 0.65rem; color: #4a6080; margin-left: 3px; }
.pa-res-w { color: #4ade80; font-weight: 700; }
.pa-res-d { color: #9ab; }
.pa-res-l { color: #f87171; font-weight: 700; }
.pa-empty { color: #4a6080; font-size: 0.8rem; padding: 12px 0; }

/* 시즌 요약 */
.pa-season-wrap { margin-bottom: 16px; }

/* 활동량 지수 */
.pa-activity-wrap { margin-bottom: 16px; }
.pa-activity-score-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}
.pa-activity-score-label { color: #aac; font-size: 13px; }
.pa-activity-score-val {
    font-size: 26px;
    font-weight: 700;
    color: #4ea4f8;
}
.pa-activity-score-unit { font-size: 13px; color: #667; font-weight: 400; }

/* 월별 차트 */
.pa-monthly-wrap { }

/* 득점 선수 클릭 스타일 */
.scorer-link {
    cursor: pointer;
    transition: color 0.15s;
}
.scorer-link:hover { color: #4ea4f8 !important; text-decoration: underline; }

/* 예측 보고서 순위 뱃지 */
.pred-standing {
    display: flex; align-items: center; gap: 6px;
    margin: 4px 0 6px;
    flex-wrap: wrap;
}
.pst-rank {
    background: rgba(78,164,248,0.15); border: 1px solid rgba(78,164,248,0.35);
    color: #4ea4f8; border-radius: 5px; font-size: 0.8rem; font-weight: 700;
    padding: 1px 7px;
}
.pst-pts {
    color: #fbbf24; font-size: 0.75rem; font-weight: 600;
}
.pst-record { color: #667; font-size: 0.7rem; }
.pst-gd     { font-size: 0.7rem; font-weight: 600; }

/* ══════════════════════════════════════════════════════════
   리그 인사이트 대시보드 (#league-dashboard)
══════════════════════════════════════════════════════════ */
#league-dashboard {
    background: linear-gradient(180deg, #0b1226 0%, #0d1530 100%);
    border-top: 1px solid rgba(78,164,248,0.15);
    padding: 24px clamp(12px, 3vw, 48px) 40px;
}

/* 헤더 */
.ld-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.ld-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #c8d8f0;
    margin: 0;
    letter-spacing: 0.02em;
}

/* 연도 필터 */
.ld-year-filter { display: flex; flex-direction: column; gap: 6px; }
.ld-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.ld-filter-label {
    color: #5a7a8a; font-size: 0.68rem; font-weight: 700;
    letter-spacing: 0.5px; min-width: 32px;
}
.ld-year-btn,
.ld-league-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #667; border-radius: 5px; font-size: 0.72rem;
    padding: 3px 10px; cursor: pointer; transition: all 0.15s;
}
.ld-year-btn:hover { color: #aac; border-color: rgba(78,164,248,0.4); }
.ld-year-btn.active {
    background: rgba(78,164,248,0.15);
    border-color: rgba(78,164,248,0.5);
    color: #4ea4f8;
}
.ld-league-btn:hover { color: #aac; border-color: rgba(184,126,248,0.4); }
.ld-league-btn.active {
    background: rgba(184,126,248,0.15);
    border-color: rgba(184,126,248,0.5);
    color: #b87ef8;
    font-weight: 700;
}

/* 카드 수령 순위 */
.ins-card-mode-tab {
    background: none; border: 1px solid transparent;
    color: #667; font-size: 0.78rem; font-weight: 600;
    padding: 4px 12px; border-radius: 5px; cursor: pointer;
    transition: all 0.15s;
}
.ins-card-mode-tab:hover { color: #aac; }
.ins-card-mode-tab.active {
    background: rgba(252,204,21,0.12);
    color: #facc15;
    border-color: rgba(252,204,21,0.3);
}

/* 카드 패널 컨트롤 — mode 탭 + 자체 league 탭 */
.ins-card-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.ins-card-controls .ins-pos-tabs { margin-bottom: 0; }
.ins-card-league-tabs {
    display: flex;
    gap: 4px;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    padding: 3px;
}
.ins-card-league-tab {
    background: none;
    border: none;
    color: #6a8aa8;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: all 0.15s;
}
.ins-card-league-tab:hover { color: #c8d8f0; }
.ins-card-league-tab:focus-visible {
    outline: 2px solid rgba(126,207,255,0.5);
    outline-offset: 1px;
}
.ins-card-league-tab.active {
    background: rgba(126,207,255,0.16);
    color: #7ecfff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.ins-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.ins-card-half { min-width: 0; }
.ins-card-subtitle {
    font-size: 0.72rem; font-weight: 700; color: #c8d8f0;
    margin-bottom: 6px; padding-bottom: 4px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.ins-card-table { font-size: 0.76rem; }   /* 0.72→0.76 (12px↑) */

/* xG 효율 리더보드 — 카드 패널과 동일 톤, accent만 보라 */
.ins-xg-mode-tab {
    background: none; border: 1px solid transparent;
    color: #8890a8; font-size: 0.78rem; font-weight: 600;   /* #667→#8890a8 비활성 탭 가독성 */
    padding: 4px 12px; border-radius: 5px; cursor: pointer;
    transition: all 0.15s;
}
.ins-xg-mode-tab:hover { color: #c8d2e8; }
.ins-xg-mode-tab.active {
    background: rgba(184,126,248,0.14);
    color: #c79ef8;
    border-color: rgba(184,126,248,0.35);
}
.ins-xg-league-tab {
    background: none; border: none; color: #8aa0bb;   /* #6a8aa8→#8aa0bb 가독성 */
    font-size: 0.72rem; font-weight: 600;
    padding: 3px 10px; border-radius: 4px; cursor: pointer;
    letter-spacing: 0.02em; transition: all 0.15s;
}
.ins-xg-league-tab:hover { color: #c8d8f0; }
.ins-xg-league-tab.active {
    background: rgba(126,207,255,0.16);
    color: #7ecfff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
#ins-xg-league-tabs {
    display: flex; gap: 4px;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px; padding: 3px;
}
#ins-panel-xg .ins-table { font-size: 0.76rem; }   /* 0.72→0.76 */
#ins-panel-xg .ins-team-cell { color: #9ec2e8; font-size: 0.74rem; }   /* 대비·크기 ↑ */
#ins-panel-xg .ins-sub { color: #93acc6; font-size: 0.68rem; font-weight: 400; }   /* sub 가독성 #6a8aa8→#93acc6 */
.ins-card-table tbody td.ins-neg { color: #f87171; font-weight: 700; }
.ins-card-foot {
    color: #7e98ad; font-size: 0.66rem; margin-top: 6px; text-align: center;   /* 푸터 대비·크기 ↑ */
    font-style: italic;
}
@media (max-width: 768px) {
    .ins-card-grid { grid-template-columns: 1fr; }
}

/* 메인 탭 */
.ld-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    margin-bottom: 16px;
}
.ld-tab {
    background: none; border: none;
    color: #556; font-size: 0.82rem; font-weight: 600;
    padding: 8px 18px; cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}
.ld-tab:hover { color: #9ab; }
.ld-tab.active { color: #4ea4f8; border-bottom-color: #4ea4f8; }

/* 패널 */
.ld-panel { }
.ld-panel.hidden { display: none; }

/* 랭킹 서브탭 */
.ld-rank-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 12px;
}
.ld-rank-tab {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: #667; border-radius: 6px; font-size: 0.75rem;
    padding: 5px 14px; cursor: pointer; transition: all 0.15s;
}
.ld-rank-tab:hover { color: #9ab; }
.ld-rank-tab.active {
    background: rgba(78,164,248,0.12);
    border-color: rgba(78,164,248,0.4);
    color: #4ea4f8;
}

/* 랭킹 테이블 */
.ld-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
}
.ld-table {
    width: 100%; border-collapse: collapse;
    font-size: 0.8rem; color: #9ab;
}
.ld-table thead tr {
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.ld-table th {
    color: #4a6a8a; font-weight: 600; text-align: left;
    padding: 8px 12px; white-space: nowrap;
}
.ld-table td { padding: 7px 12px; border-bottom: 1px solid rgba(255,255,255,0.03); white-space: nowrap; }
.ld-player-row { cursor: pointer; transition: background 0.1s; }
.ld-player-row:hover td { background: rgba(78,164,248,0.07); }

/* 랭킹 번호 */
.ld-rank-num { font-weight: 700; color: #4a6080; min-width: 28px; text-align: center; }
.ld-rank-gold   { color: #fbbf24; }
.ld-rank-silver { color: #94a3b8; }
.ld-rank-bronze { color: #b87333; }

/* 포지션 배지 */
.ld-pos-badge {
    display: inline-block;
    border-radius: 4px; font-size: 0.68rem; font-weight: 700;
    padding: 1px 5px; border: 1px solid transparent;
}
.ld-pos-f { background: rgba(248,113,113,0.15); border-color: rgba(248,113,113,0.3); color: #f87171; }
.ld-pos-m { background: rgba(78,164,248,0.15);  border-color: rgba(78,164,248,0.3);  color: #4ea4f8; }
.ld-pos-d { background: rgba(74,222,128,0.15);  border-color: rgba(74,222,128,0.3);  color: #4ade80; }
.ld-pos-g { background: rgba(251,191,36,0.15);  border-color: rgba(251,191,36,0.3);  color: #fbbf24; }

/* 선수명 / 팀명 */
.ld-player-name { color: #c8d8f0; font-weight: 600; }
.ld-team-name   { color: #5a7a9a; font-size: 0.74rem; }
.ld-main-val    { color: #4ea4f8; font-weight: 700; font-size: 0.9rem; }

/* 포지션 분석 */
.ld-section-label {
    font-size: 0.72rem; color: #4a6a8a;
    text-transform: uppercase; letter-spacing: 0.06em;
    margin-bottom: 8px;
}
.ld-pos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.ld-pos-chart-wrap { }

/* ══════════════════════════════════════════════════════════
   선수 개별 분석 보고서 (#player-report-section)
══════════════════════════════════════════════════════════ */
#board-report-wrap {
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

#main-row {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
}

#player-report-section {
    flex: 0 0 clamp(420px, 36vw, 600px);
    width: clamp(420px, 36vw, 600px);
    height: clamp(400px, 62vh, 820px);
    overflow-y: auto;
    background: linear-gradient(180deg, #0b1226 0%, #0d1530 100%);
    border: 1px solid var(--bg-elevated);
    border-left: none;
    border-radius: 0;
    padding: 16px;
    box-sizing: border-box;
    transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

/* 확장 모드: 고정 영역 → 화면 중앙 풀스크린 모달로 morph */
#player-report-section.pr-expanded {
    position: fixed;
    top: 3vh;
    left: 50%;
    transform: translateX(-50%);
    width: min(1100px, 94vw);
    max-width: 1100px;
    height: 94vh;
    max-height: 94vh;
    z-index: 200;
    border: 1px solid rgba(233, 69, 96, 0.35);
    border-radius: 14px;
    padding: 22px 28px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    background: linear-gradient(180deg, #0b1226 0%, #0d1832 60%, #0e1a38 100%);
}

/* 백드롭 */
.pr-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 18, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease-out;
}
.pr-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* 확장 버튼 */
.pr-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.pr-expand-btn {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #c8d8f0;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.pr-expand-btn:hover {
    background: rgba(233, 69, 96, 0.18);
    border-color: rgba(233, 69, 96, 0.5);
    color: #fff;
}
.pr-expand-btn:active { transform: scale(0.95); }
#player-report-section.pr-expanded .pr-expand-icon::before {
    content: "✕";
}
#player-report-section.pr-expanded .pr-expand-icon {
    font-size: 0;
}
#player-report-section.pr-expanded .pr-expand-icon::before {
    font-size: 1rem;
}
#player-report-section.pr-expanded .pr-expand-btn {
    border-color: rgba(233, 69, 96, 0.4);
    background: rgba(233, 69, 96, 0.12);
    color: #ffd166;
}

/* 확장 시 내부 차트 / 스탯 바 크기 업그레이드 */
#player-report-section.pr-expanded .pr-title {
    font-size: 1.35rem;
}
#player-report-section.pr-expanded #pr-body {
    max-width: 1040px;
    margin: 0 auto;
}
#player-report-section.pr-expanded .pr-card {
    padding: 18px 22px;
}
body.pr-expanded-lock {
    overflow: hidden;
}

/* 중간 해상도 (1280px 이하): 선수 리포트를 전술판 아래로 스택
   — #main-row를 column으로 전환해 캔버스가 찌그러지는 것 방지 */
@media (max-width: 1280px) {
    #main-row {
        flex-direction: column;
    }
    #player-report-section {
        flex: 0 0 auto;
        width: 100%;
        height: auto;
        min-height: 320px;
        max-height: 560px;
        border-left: 1px solid var(--bg-elevated);
        border-top: none;
    }
}
.pr-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px; margin-bottom: 16px;
}
.pr-title { font-size:1.1rem; font-weight:700; color:#c8d8f0; margin:0; }
.pr-year-filter { display:flex; flex-wrap:wrap; gap:5px; }
.pr-yr-btn {
    background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.1);
    color:#667; border-radius:5px; font-size:0.72rem; padding:3px 10px; cursor:pointer;
}
.pr-yr-btn:hover { color:#aac; }
.pr-yr-btn.active { background:rgba(74,222,128,0.12); border-color:rgba(74,222,128,0.4); color:#4ade80; }

.pr-loading, .pr-empty {
    text-align:center; color:#4a6080; padding:32px; font-size:0.9rem;
}
.pr-empty strong { color:#4ea4f8; }

/* 카드 */
.pr-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 14px;
}
.pr-section-title {
    font-size:0.72rem; color:#4a6a8a;
    text-transform:uppercase; letter-spacing:0.06em;
    margin-bottom: 12px;
}
.pr-pos-tag {
    font-size:0.68rem; text-transform:none;
    background:rgba(78,164,248,0.12); border:1px solid rgba(78,164,248,0.25);
    color:#4ea4f8; border-radius:4px; padding:1px 6px; margin-left:6px;
}

/* 선수 헤더 */
.pr-info-card { margin-bottom:14px; }
.pr-player-header { display:flex; align-items:center; flex-wrap:wrap; gap:10px; }
.pr-pos-badge {
    border-radius:6px; border:1px solid; font-size:0.78rem; font-weight:700;
    padding:3px 10px; white-space:nowrap;
}
.pr-player-name { font-size:1.3rem; font-weight:700; color:#e8f0fc; }
.pr-player-team { font-size:0.82rem; color:#5a7a9a; }
.pr-info-badges { display:flex; flex-wrap:wrap; gap:5px; width:100%; margin-top:4px; }
.pr-badge {
    background:rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.1);
    color:#9ab; border-radius:20px; font-size:0.75rem; padding:3px 10px;
}
.pr-badge-goal    { background:rgba(248,113,113,0.1); border-color:rgba(248,113,113,0.3); color:#f87171; }
.pr-badge-assist  { background:rgba(78,164,248,0.1);  border-color:rgba(78,164,248,0.3);  color:#4ea4f8; }
.pr-badge-rating  { background:rgba(251,191,36,0.1);  border-color:rgba(251,191,36,0.3);  color:#fbbf24; }
.pr-badge-phys    { background:rgba(255,255,255,0.05); }
.pr-peer-note { width:100%; font-size:0.7rem; color:#3a5060; margin-top:4px; }

/* 2컬럼 메인 그리드 */
.pr-main-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 14px;
}

/* 레이더 */
.pr-radar-card {
    display: grid;
    grid-template-columns: 220px 1fr;
    align-items: start;
    gap: 20px;
}
.pr-radar-canvas-wrap { flex-shrink: 0; }
#pr-radar-canvas { width: 100%; max-width: 220px; max-height: 220px; }
.pr-stats-card { min-width: 0; }

/* 스탯 리스트 */
.pr-stat-list { display:flex; flex-direction:column; gap:10px; }
.pr-stat-item { }
.pr-stat-label {
    display:flex; align-items:center; gap:6px;
    font-size:0.78rem; color:#9ab; margin-bottom:4px;
}
.pr-stat-icon { font-size:0.9rem; }
.pr-stat-val  { margin-left:auto; color:#c8d8f0; font-weight:600; font-size:0.82rem; }
.pr-pct-bar-wrap {
    background:rgba(255,255,255,0.06); border-radius:4px; height:8px; overflow:hidden;
}
.pr-pct-bar {
    height:100%; border-radius:4px;
    transition: width 0.6s cubic-bezier(.4,0,.2,1);
}
.pr-pct-info {
    display:flex; justify-content:space-between;
    font-size:0.7rem; margin-top:2px;
}
.pr-grade { font-weight:600; }

/* 활동량 */
.pr-activity-card .pr-section-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pr-activity-score {
    margin-left: auto;
    font-size: 1.2rem;
    font-weight: 700;
    color: #4ea4f8;
}
.pr-activity-score small { font-size: 0.7rem; color: #667; font-weight: 400; }

/* 최근 폼 테이블 */
.pr-table-wrap { overflow-x:auto; }
.pr-table {
    width:100%; border-collapse:collapse; font-size:0.78rem; color:#9ab;
}
.pr-table th {
    color:#4a6a8a; font-weight:600; text-align:left;
    padding:6px 10px; border-bottom:1px solid rgba(255,255,255,0.07);
    white-space:nowrap;
}
.pr-table td { padding:6px 10px; border-bottom:1px solid rgba(255,255,255,0.04); white-space:nowrap; }
.pr-table tr:hover td { background:rgba(74,222,128,0.04); }
.pr-ha   { font-size:0.65rem; color:#4a6080; }
.pr-res-w { color:#4ade80; font-weight:700; }
.pr-res-d { color:#9ab; }
.pr-res-l { color:#f87171; font-weight:700; }

/* 편집 팝업 분석 버튼 */
.player-edit-report-btn {
    flex: 1;
    padding: 6px;
    border-radius: 5px;
    border: 1px solid #2a5a8a;
    background: #0d3a5e;
    color: #4ea4f8;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.player-edit-report-btn:hover { background: #1a5a8e; }

/* ══════════════════════════════════════════════════════════
   득점/실점 시간대 분석 (.gt-*)
══════════════════════════════════════════════════════════ */
.gt-section {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.gt-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #8ab0d0;
    margin-bottom: 10px;
    letter-spacing: 0.02em;
}
.gt-loading, .gt-empty {
    font-size: 0.75rem;
    color: #4a6080;
    padding: 8px 0;
    text-align: center;
}
.gt-half-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.gt-half-block {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border-radius: 7px;
    padding: 7px 10px;
    text-align: center;
}
.gt-half-label {
    font-size: 0.68rem;
    color: #556;
    margin-bottom: 4px;
}
.gt-half-vals {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.gt-half-num {
    font-size: 1.2rem;
    font-weight: 700;
}
.gt-half-sep {
    color: #4a6080;
    font-size: 1rem;
}
.gt-gf .gt-half-num { color: #4ade80; }
.gt-ga .gt-half-num { color: #f87171; }

/* ── 포지션 인사이트 섹션 ───────────────────────────── */
#insights-section {
    background: rgba(10,15,30,0.85);
    padding: clamp(32px, 4vh, 56px) clamp(20px, 2.5vw, 40px);
    margin-top: clamp(16px, 2vh, 28px);
    border-top: 1px solid rgba(78,164,248,0.15);
}
#insights-section .ld-header {
    margin-bottom: clamp(20px, 2.4vh, 32px);
    padding-bottom: clamp(12px, 1.4vh, 20px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
#insights-section .ld-title {
    font-size: clamp(1.1rem, 1.4vw, 1.3rem);
    line-height: 1.4;
}
/* TOP 퍼포머(전 지표·전 너비) → 카드 순위 순으로 세로 스택 */
#insights-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.ins-block {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 0;
}
.ins-block-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #c8d8f0;
    margin-bottom: 12px;
}
.ins-block-hint { font-size: 0.7rem; font-weight: 400; color: #8aa2bd; margin-left: 8px; }
/* 인사이트 탭 (랭킹/심화/규율) — 한 번에 하나만 */
.ins-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.ins-tab { background: transparent; border: none; border-bottom: 2px solid transparent; color: #8aa0b8; padding: 9px 16px; cursor: pointer; font-size: 0.86rem; font-weight: 700; transition: color .15s, border-color .15s; margin-bottom: -1px; }
.ins-tab:hover { color: #cdd8e8; }
.ins-tab.active { color: #7ecfff; border-bottom-color: #4ea4f8; }
/* 탭 비활성 패널 숨김 — .hidden 전역 규칙이 없어 패널별로 명시 (이게 없으면 탭이 안 먹음) */
#insights-grid .ins-block.hidden, [data-itab-panel].hidden { display: none; }
/* 부문별 TOP 카드 — 각 부문 1위를 한눈에 (클릭 시 해당 지표 정렬) */
.ins-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.ins-cat-card {
    text-align: left;
    background: linear-gradient(180deg, rgba(100,180,255,0.08), rgba(100,180,255,0.03));
    border: 1px solid rgba(100,180,255,0.16);
    border-radius: 10px;
    padding: 9px 11px;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ins-cat-card:hover { background: linear-gradient(180deg, rgba(100,180,255,0.16), rgba(100,180,255,0.06)); border-color: rgba(100,180,255,0.34); transform: translateY(-1px); }
.ins-cat-head { display: flex; align-items: center; gap: 5px; }
.ins-cat-icon { font-size: 0.9rem; }
.ins-cat-label { font-size: 0.72rem; font-weight: 700; color: #9fb4cc; letter-spacing: 0.2px; }
.ins-cat-val { font-size: 1.15rem; font-weight: 800; color: #e8f0fb; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ins-cat-leader { font-size: 0.76rem; color: #c8d8f0; font-weight: 600; display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── 심화 인사이트 (날씨·승부처·폼·활동량) ── */
.ins-adv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ins-adv-card { background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.06); border-radius: 9px; padding: 12px 14px; }
.ins-adv-h { font-size: 0.86rem; font-weight: 700; color: #d8e4f0; margin-bottom: 8px; }
.ins-adv-sub-h { font-size: 0.72rem; font-weight: 700; color: #9fb4cc; margin: 10px 0 5px; }
.ins-adv-tbl { width: 100%; border-collapse: collapse; font-size: 0.76rem; }
.ins-adv-tbl th { color: #7ecfff; font-weight: 600; text-align: left; padding: 3px 6px; border-bottom: 1px solid rgba(255,255,255,0.1); white-space: nowrap; }
.ins-adv-tbl td { padding: 3px 6px; color: #cdd8e8; border-bottom: 1px solid rgba(255,255,255,0.04); }
.ins-adv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.ins-adv-list li { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: #d2deed; }
.ins-adv-rank { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; border-radius: 4px; background: rgba(100,180,255,0.14); color: #8fc2ff; font-size: 0.66rem; font-weight: 700; }
.ins-adv-nm { font-weight: 600; }
.ins-adv-sub { color: #8aa0b8; font-size: 0.7rem; }
.ins-adv-list li b { margin-left: auto; color: #e8f0fb; font-variant-numeric: tabular-nums; }
.ins-adv-delta { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 52px; }
.ins-adv-empty { color: #7a8aa0; font-style: italic; font-size: 0.74rem; }
/* 시간대별 득점 — 값 라벨 + 점유율 + 최다 시간대 강조 */
.ins-tl-total { font-size: 0.68rem; font-weight: 600; color: #8aa0b8; margin-left: 6px; }
.ins-tl { display: flex; align-items: flex-end; gap: 6px; padding: 2px 0 0; }
.ins-tl-col { flex: 1; display: flex; flex-direction: column; align-items: center; }
.ins-tl-val { font-size: 0.66rem; font-weight: 700; color: #c8d8f0; margin-bottom: 2px; font-variant-numeric: tabular-nums; }
.ins-tl-track { width: 100%; height: 76px; display: flex; align-items: flex-end; background: rgba(255,255,255,0.03); border-radius: 4px; }
.ins-tl-bar { width: 100%; min-height: 3px; background: linear-gradient(180deg, #6fb4ff, #3d7fd6); border-radius: 4px 4px 0 0; transition: height .5s cubic-bezier(.22,1,.36,1); }
.ins-tl-col:hover .ins-tl-bar { filter: brightness(1.15); }
.ins-tl-peak .ins-tl-bar { background: linear-gradient(180deg, #ffb24d, #f08a2e); box-shadow: 0 0 10px rgba(240,138,46,0.45); }
.ins-tl-peak .ins-tl-val { color: #ffc870; }
.ins-tl-lbl { font-size: 0.56rem; color: #8aa0b8; margin-top: 4px; white-space: nowrap; display: flex; flex-direction: column; align-items: center; line-height: 1.25; }
.ins-tl-share { color: #6f86a2; font-size: 0.54rem; }
.ins-tl-summary { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 9px; font-size: 0.72rem; color: #aab8cc; }
.ins-tl-sg b { color: #e8f0fb; font-weight: 800; }
.ins-tl-sg-peak b { color: #ffc870; }
.ins-clutch-hint { font-size: 0.66rem; font-weight: 600; color: #8aa0b8; margin-left: 6px; }
@media (max-width: 760px) { .ins-adv-grid { grid-template-columns: 1fr; } }
/* 산식/근거 캡션 — 신빙성 표시 */
.ins-method { margin-top: 9px; padding-top: 7px; border-top: 1px dashed rgba(255,255,255,0.10); font-size: 0.68rem; color: #8090a6; line-height: 1.5; }
/* 산식 안내 — 표 위에 크게/박스로 (예전 하단 작은 footnote → 상단 강조) */
.ins-formula { margin-bottom: 12px; padding: 11px 14px; background: rgba(100,180,255,0.07); border: 1px solid rgba(100,180,255,0.18); border-left: 3px solid #4ea4f8; border-radius: 8px; }
.ins-formula-head { font-size: 0.86rem; font-weight: 700; color: #eaf2fc; margin-bottom: 8px; }
.ins-formula-tag { font-size: 0.68rem; font-weight: 600; color: #8aa0b8; margin-left: 5px; }
.ins-formula-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.ins-formula-list li { display: flex; align-items: center; gap: 9px; font-size: 0.8rem; color: #d2deed; flex-wrap: wrap; }
.ins-fm-name { display: inline-block; min-width: 50px; font-weight: 800; color: #7ecfff; }
.ins-fm-eq { color: #cdd8e8; }
.ins-formula-avg { font-size: 0.7rem; color: #9fd0ff; background: rgba(100,180,255,0.16); border-radius: 4px; padding: 1px 7px; font-weight: 700; margin-left: auto; white-space: nowrap; }
.ins-formula-sub { color: #8aa0b8; font-size: 0.73rem; margin-top: 9px; padding-top: 7px; border-top: 1px solid rgba(255,255,255,0.07); line-height: 1.5; }
.ins-method b { color: #aab8cc; font-weight: 700; }
.ins-th-tip { font-size: 0.62rem; color: #6f86a2; margin-left: 2px; cursor: help; vertical-align: super; }
.ins-adv-loading { font-size: 0.76rem; color: #7a8aa0; padding: 14px 4px; font-style: italic; }
.ins-pos-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.ins-pos-tab { background: rgba(255,255,255,0.07); color: #aaa; border: none; padding: 5px 12px; border-radius: 5px; cursor: pointer; font-size: 0.8rem; transition: background .15s, color .15s; }
.ins-pos-tab:hover { background: rgba(255,255,255,0.12); color: #d8e4f0; }
.ins-pos-tab.active { background: rgba(100,180,255,0.2); color: #7ecfff; }
/* 통합 리더보드 포지션 배지 — 색상만이 아닌 텍스트(공격/미드/수비)로도 구분 (색맹 고려) */
.ins-pos-badge { display: inline-block; min-width: 32px; text-align: center; padding: 1px 7px; border-radius: 4px; font-size: 0.7rem; font-weight: 600; background: rgba(255,255,255,0.08); color: #c8d8f0; }
.ins-pos-badge.ins-pos-F { background: rgba(248,113,113,0.18); color: #f8a8a8; }
.ins-pos-badge.ins-pos-M { background: rgba(78,164,248,0.18); color: #93c4ff; }
.ins-pos-badge.ins-pos-D { background: rgba(74,222,128,0.16); color: #8ce8ab; }
.ins-pos-badge.ins-pos-G { background: rgba(251,191,36,0.16); color: #f3cf6e; }
.ins-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.ins-table th { color: #7ecfff; font-weight: 600; padding: 6px 10px; border-bottom: 1px solid rgba(255,255,255,0.1); text-align: left; white-space: nowrap; }
.ins-table td { padding: 6px 10px; border-bottom: 1px solid rgba(255,255,255,0.05); color: #ccc; }
.ins-table tr:hover td { background: rgba(255,255,255,0.04); }
/* TOP 퍼포머 — 길어진 통합표를 가볍게: 스크롤 캡 + 헤더 고정 + zebra + 더보기 */
.ins-top-scroll { max-height: 600px; overflow-y: auto; overflow-x: auto; border-radius: 8px; }
/* 종합 지표 컬럼이 많아 좁은 칸에선 가로 스크롤 (헤더는 세로 고정 유지) */
#ins-top-body .ins-table { min-width: 760px; }
.ins-top-scroll::-webkit-scrollbar { width: 8px; }
.ins-top-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }
#ins-top-body .ins-table thead th { position: sticky; top: 0; z-index: 2; background: #141d31; }
#ins-top-body .ins-table tbody tr:nth-child(even) td { background: rgba(255,255,255,0.022); }
#ins-top-body .ins-table tbody tr:hover td { background: rgba(100,180,255,0.10); }
.ins-top-more { width: 100%; margin-top: 10px; padding: 8px 10px; background: rgba(100,180,255,0.10); color: #7ecfff; border: 1px solid rgba(100,180,255,0.25); border-radius: 6px; cursor: pointer; font-size: 0.8rem; font-weight: 600; transition: background 0.15s, border-color 0.15s; }
.ins-top-more:hover { background: rgba(100,180,255,0.18); border-color: rgba(100,180,255,0.4); }
.ins-th-sort { cursor: pointer; user-select: none; transition: color 0.15s; white-space: nowrap; }
.ins-th-sort:hover { color: #a8d8ff; }
.ins-th-active { color: #fff !important; }
.ins-sort-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 3px;
  background: rgba(100,180,255,0.35); color: #7ecfff;
  font-size: 0.65rem; font-weight: 700;
  margin-left: 3px; vertical-align: middle;
}
.ins-sort-arrow { font-size: 0.75rem; margin-left: 2px; color: #7ecfff; }
.ins-sort-hint { font-size: 0.65rem; color: #445; margin-left: 3px; }
.ins-rank { color: #556; font-size: 0.75rem; width: 28px; }
.ins-name { color: #fff; font-weight: 500; }
.ins-team { color: #7ab0e0; font-size: 0.85em; white-space: nowrap; }
.ins-pos { color: #4ade80; font-weight: 600; }
.ins-neg { color: #f87171; font-weight: 600; }
.ins-section-label { font-size: 0.8rem; color: #7ecfff; margin-bottom: 10px; }
.ins-fwd-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 16px; }
.ins-fwd-select-wrap { display: flex; align-items: center; gap: 12px; }
.ins-select { background: rgba(255,255,255,0.08); color: #ccc; border: 1px solid rgba(255,255,255,0.15); border-radius: 6px; padding: 5px 10px; font-size: 0.82rem; min-width: 200px; }
.ins-empty { color: #556; font-size: 0.85rem; padding: 20px 0; }
.ins-row-clickable { cursor: pointer; transition: background 0.15s; }
.ins-row-clickable:hover td { background: rgba(100,180,255,0.08) !important; }

/* ── 선수 상세 드로어 ── */
.drawer-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 900;
}
.drawer-overlay.open { display: block; }

.player-drawer {
  position: fixed; top: 0; right: -520px; width: 500px; height: 100vh;
  background: #0d1526; border-left: 1px solid rgba(100,160,255,0.2);
  z-index: 901; transition: right 0.3s ease; overflow-y: auto;
  box-shadow: -8px 0 32px rgba(0,0,0,0.5);
}
.player-drawer.open { right: 0; }

.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px; border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky; top: 0; background: #0d1526; z-index: 1;
}
.drawer-name { font-size: 1.2rem; font-weight: 700; color: #e8f0ff; }
.drawer-sub  { font-size: 0.82rem; color: #7ab0e0; margin-top: 3px; }
.drawer-close {
  background: none; border: 1px solid rgba(255,255,255,0.15);
  color: #aaa; border-radius: 6px; padding: 4px 10px;
  cursor: pointer; font-size: 0.9rem; transition: all 0.15s;
}
.drawer-close:hover { border-color: #f87171; color: #f87171; }
.drawer-full-btn {
    background: rgba(78,164,248,0.12);
    border: 1px solid rgba(78,164,248,0.35);
    color: #4ea4f8;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.drawer-full-btn:hover { background: rgba(78,164,248,0.25); }

.drawer-body { padding: 20px 24px 40px; }
.drawer-section-title { font-size: 0.88rem; font-weight: 700; color: #7ecfff; margin-bottom: 10px; }

/* 시즌 필터 (드로어 내부) */
.drawer-year-filter {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.drawer-year-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: #8aa0bb;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: all 0.15s ease;
}
.drawer-year-btn:hover {
    background: rgba(126,207,255,0.08);
    color: #c8d8f0;
    border-color: rgba(126,207,255,0.2);
}
.drawer-year-btn:focus-visible {
    outline: 2px solid rgba(126,207,255,0.5);
    outline-offset: 1px;
}
.drawer-year-btn.active {
    background: rgba(126,207,255,0.18);
    color: #7ecfff;
    border-color: rgba(126,207,255,0.4);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* 시즌 요약 KPI 카드 */
.drawer-summary {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 22px;
    padding: 14px 12px;
    background: linear-gradient(135deg, rgba(20,32,58,0.55), rgba(15,24,42,0.35));
    border: 1px solid rgba(126,207,255,0.1);
    border-radius: 10px;
}
.kpi-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 0;
}
.kpi-val {
    font-size: 1.05rem;
    font-weight: 800;
    color: #e8f2ff;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.kpi-val.kpi-pos { color: #4ade80; }
.kpi-val.kpi-neg { color: #f87171; }
.kpi-val.kpi-accent-g { color: #4ade80; }
.kpi-val.kpi-accent-b { color: #7ecfff; }
.kpi-val.kpi-accent-p { color: #c79ef8; }
.kpi-lbl {
    font-size: 0.6rem;
    color: #7e92ad;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
@media (max-width: 600px) {
    .drawer-summary { grid-template-columns: repeat(3, 1fr); }
}

/* ── 팀 비교 모달 (Team Compare) — 모닝 피치 & 스카이 파스텔 테마 ─────── */
.tc-modal-content {
    /* 테마 변수 */
    --tc-ink:         #1f2d47;
    --tc-ink-soft:    #5a6c85;
    --tc-ink-muted:   #8592a8;
    --tc-accent:      #4a82c7;
    --tc-accent-warm: #e06d4f;
    --tc-gold:        #c98a2e;
    --tc-mint:        #52b58a;
    --tc-rose:        #e57579;
    --tc-border:      rgba(90, 110, 140, 0.16);
    --tc-border-soft: rgba(90, 110, 140, 0.08);
    --tc-card:        #ffffff;

    width: 94vw;
    max-width: 1100px;
    max-height: 92vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px 26px 28px;
    color: var(--tc-ink);
    background:
        radial-gradient(ellipse 70% 60% at 85% 10%, #ffe3cf 0%, transparent 55%),
        radial-gradient(ellipse 70% 60% at 10% 95%, #d9ecff 0%, transparent 55%),
        linear-gradient(135deg, #fef7ee 0%, #f2f6ff 100%);
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 22px 60px rgba(50, 70, 110, 0.28), inset 0 1px 0 rgba(255,255,255,0.9);
}
.tc-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--tc-border);
}
.tc-title {
    font-size: 1.28rem;
    margin: 0;
    flex: 0 0 auto;
    font-weight: 800;
    letter-spacing: 0.3px;
    background: linear-gradient(135deg, #e06d4f 0%, #4a82c7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.tc-header #tc-close {
    margin-left: auto;
    background: #fff;
    color: var(--tc-ink-soft);
    border: 1px solid var(--tc-border);
}
.tc-header #tc-close:hover { background: #fef3e7; color: var(--tc-accent-warm); }

.tc-selects {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 4px 0 2px;
}
.tc-team-select {
    background: #ffffff;
    color: var(--tc-ink);
    border: 1px solid var(--tc-border);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.96rem;
    font-weight: 600;
    min-width: 220px;
    transition: all 0.2s;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(60, 80, 130, 0.06);
}
.tc-team-select:hover {
    border-color: var(--tc-accent);
    box-shadow: 0 2px 10px rgba(74, 130, 199, 0.18);
}
.tc-team-select:focus {
    outline: none;
    border-color: var(--tc-accent);
    box-shadow: 0 0 0 3px rgba(74, 130, 199, 0.22);
}
.tc-vs {
    font-size: 1.55rem;
    font-weight: 900;
    letter-spacing: 3px;
    background: linear-gradient(135deg, #ff9f6b, #e57579);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: tc-vs-pulse 2.4s ease-in-out infinite;
}
@keyframes tc-vs-pulse {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(255, 159, 107, 0.35)); }
    50%      { filter: drop-shadow(0 0 10px rgba(229, 117, 121, 0.5)); }
}

.tc-body.hidden, .tc-empty.hidden { display: none; }
.tc-empty {
    text-align: center;
    color: var(--tc-ink-muted);
    padding: 60px 0;
    font-size: 0.98rem;
}

/* ── 매치업 포스터 헤더 ── */
.tc-title-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    padding: 22px 20px;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse 60% 120% at 0% 50%, var(--tc-color-a, rgba(74, 130, 199, 0.18)) 0%, transparent 55%),
        radial-gradient(ellipse 60% 120% at 100% 50%, var(--tc-color-b, rgba(224, 109, 79, 0.18)) 0%, transparent 55%),
        linear-gradient(180deg, #ffffff, #faf6f0);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 1px 0 rgba(255,255,255,1), 0 8px 24px rgba(70, 90, 140, 0.10);
    animation: tc-fade-in 0.5s ease-out;
}
.tc-title-row::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent 0, transparent 80px,
        rgba(90, 110, 140, 0.03) 80px, rgba(90, 110, 140, 0.03) 81px
    );
    pointer-events: none;
}
@keyframes tc-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tc-team-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 1;
}
.tc-team-card-a { order: 1; }
.tc-team-card-b { order: 3; }
.tc-badge-middle { order: 2; text-align: center; position: relative; z-index: 1; }

.tc-emblem {
    width: 72px;
    height: 72px;
    object-fit: contain;
    filter: drop-shadow(0 6px 14px rgba(60, 80, 130, 0.22)) drop-shadow(0 0 18px var(--tc-glow, rgba(74, 130, 199, 0.25)));
    transition: transform 0.3s;
    animation: tc-emblem-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tc-team-card-a .tc-emblem { --tc-glow: var(--tc-color-a, rgba(74, 130, 199, 0.35)); }
.tc-team-card-b .tc-emblem { --tc-glow: var(--tc-color-b, rgba(224, 109, 79, 0.35)); }
.tc-team-card:hover .tc-emblem { transform: scale(1.06) rotate(-2deg); }
@keyframes tc-emblem-in {
    from { opacity: 0; transform: scale(0.6); }
    to   { opacity: 1; transform: scale(1); }
}

.tc-team-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--tc-ink);
    letter-spacing: 0.2px;
}
.tc-team-league {
    font-size: 0.7rem;
    color: var(--tc-accent);
    padding: 3px 12px;
    border-radius: 10px;
    background: rgba(74, 130, 199, 0.10);
    border: 1px solid rgba(74, 130, 199, 0.18);
    letter-spacing: 1px;
    font-weight: 700;
}

.tc-h2h-summary {
    font-size: 1.7rem;
    font-weight: 900;
    color: var(--tc-gold);
    letter-spacing: 1.5px;
    font-variant-numeric: tabular-nums;
    padding: 6px 22px;
    border: 1px solid rgba(201, 138, 46, 0.30);
    border-radius: 14px;
    background: linear-gradient(180deg, #fff6e4, #fdecd1);
    box-shadow: 0 4px 14px rgba(201, 138, 46, 0.18), inset 0 1px 0 rgba(255,255,255,0.9);
    display: inline-block;
    min-width: 150px;
}
.tc-h2h-label {
    font-size: 0.7rem;
    color: var(--tc-ink-soft);
    margin-top: 8px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 700;
}

/* ── 그리드 & 패널 ── */
.tc-grid { display: grid; gap: 14px; }
.tc-grid-top { grid-template-columns: 1.1fr 0.9fr; }
@media (max-width: 880px) {
    .tc-grid-top { grid-template-columns: 1fr; }
    .tc-selects { flex-wrap: wrap; }
    .tc-team-select { min-width: 160px; }
    .tc-emblem { width: 58px; height: 58px; }
    .tc-h2h-summary { font-size: 1.4rem; min-width: 120px; padding: 4px 14px; }
}
.tc-panel {
    background: var(--tc-card);
    border: 1px solid var(--tc-border);
    border-radius: 14px;
    padding: 14px 16px 16px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,1), 0 6px 18px rgba(70, 90, 140, 0.08);
    animation: tc-fade-in 0.45s ease-out;
}
.tc-panel-label {
    font-size: 0.72rem;
    color: var(--tc-accent);
    margin: 0 0 10px;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}
.tc-hint {
    font-size: 0.72rem;
    color: var(--tc-ink-muted);
    margin: 8px 0 0;
    text-align: right;
    font-style: italic;
}

/* ── 폼 배지 ── */
.tc-form-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.tc-form-team {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--tc-ink);
    font-weight: 600;
    flex-wrap: wrap;
}
.tc-form-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px; height: 26px;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.5px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 3px 8px rgba(60, 80, 130, 0.18);
    animation: tc-form-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.tc-form-team .tc-form-badge:nth-child(2) { animation-delay: 0.05s; }
.tc-form-team .tc-form-badge:nth-child(3) { animation-delay: 0.10s; }
.tc-form-team .tc-form-badge:nth-child(4) { animation-delay: 0.15s; }
.tc-form-team .tc-form-badge:nth-child(5) { animation-delay: 0.20s; }
.tc-form-team .tc-form-badge:nth-child(6) { animation-delay: 0.25s; }
@keyframes tc-form-pop {
    from { opacity: 0; transform: scale(0.3) rotate(-90deg); }
    to   { opacity: 1; transform: scale(1) rotate(0); }
}
.tc-form-W { background: linear-gradient(145deg, #7ed0a3, #52b58a); }
.tc-form-D { background: linear-gradient(145deg, #bac4d2, #94a0b4); }
.tc-form-L { background: linear-gradient(145deg, #ff9a9d, #e57579); }

/* ── 홈/원정 테이블 ── */
.tc-ha-table {
    width: 100%;
    font-size: 0.88rem;
    color: var(--tc-ink);
    border-collapse: collapse;
    margin-top: 6px;
}
.tc-ha-table th, .tc-ha-table td {
    padding: 8px 8px;
    text-align: center;
    border-bottom: 1px solid var(--tc-border-soft);
}
.tc-ha-table th {
    color: var(--tc-accent);
    font-weight: 800;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.tc-ha-table tr:last-child td { border-bottom: none; }
.tc-ha-pct {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 12px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    background: #f7f9fc;
    border: 1px solid var(--tc-border);
}

/* ── 스탯 바 (중앙 라벨 + 양쪽 대칭 바, 팀 컬러 틴트) ── */
.tc-bars {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 2px 0;
}
.tc-bar-row {
    display: grid;
    grid-template-columns: 1fr 130px 1fr;
    align-items: center;
    gap: 14px;
    font-size: 0.9rem;
    animation: tc-bar-in 0.5s ease-out both;
}
.tc-bars > .tc-bar-row:nth-child(1)  { animation-delay: 0.00s; }
.tc-bars > .tc-bar-row:nth-child(2)  { animation-delay: 0.04s; }
.tc-bars > .tc-bar-row:nth-child(3)  { animation-delay: 0.08s; }
.tc-bars > .tc-bar-row:nth-child(4)  { animation-delay: 0.12s; }
.tc-bars > .tc-bar-row:nth-child(5)  { animation-delay: 0.16s; }
.tc-bars > .tc-bar-row:nth-child(6)  { animation-delay: 0.20s; }
.tc-bars > .tc-bar-row:nth-child(7)  { animation-delay: 0.24s; }
.tc-bars > .tc-bar-row:nth-child(8)  { animation-delay: 0.28s; }
.tc-bars > .tc-bar-row:nth-child(9)  { animation-delay: 0.32s; }
.tc-bars > .tc-bar-row:nth-child(10) { animation-delay: 0.36s; }
@keyframes tc-bar-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tc-bar-side {
    --tc-team-rgb: 74, 130, 199;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 26px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(var(--tc-team-rgb), 0.07);
    border: 1px solid rgba(var(--tc-team-rgb), 0.14);
    position: relative;
    transition: box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}
.tc-bar-side-a {
    justify-content: flex-end;
    flex-direction: row-reverse;
}
.tc-bar-fill {
    height: 100%;
    border-radius: 7px;
    transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        inset 0 -1px 0 rgba(0, 0, 0, 0.06);
}
/* A팀: 오른쪽에서 왼쪽으로 채워지므로 진한 쪽이 왼쪽 끝(=바 끝부분) */
.tc-bar-side-a .tc-bar-fill {
    background-image: linear-gradient(
        90deg,
        rgba(var(--tc-team-rgb), 1) 0%,
        rgba(var(--tc-team-rgb), 0.82) 100%
    );
}
/* B팀: 왼쪽에서 오른쪽으로 채워지므로 진한 쪽이 오른쪽 끝 */
.tc-bar-side:not(.tc-bar-side-a) .tc-bar-fill {
    background-image: linear-gradient(
        90deg,
        rgba(var(--tc-team-rgb), 0.82) 0%,
        rgba(var(--tc-team-rgb), 1) 100%
    );
}
.tc-bar-val {
    padding: 0 12px;
    color: var(--tc-ink);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 0.94rem;
    min-width: 44px;
    text-align: center;
    letter-spacing: -0.01em;
    transition: color 0.2s ease, font-size 0.2s ease;
}
.tc-bar-label {
    text-align: center;
    color: var(--tc-ink-soft);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    padding: 0 4px;
    white-space: nowrap;
}
/* 우위 — 금빛 점 대신 팀 컬러 자체로 강조 (브랜드 일체감) */
.tc-bar-side-winner {
    background: rgba(var(--tc-team-rgb), 0.10);
    border-color: rgba(var(--tc-team-rgb), 0.32);
    box-shadow:
        0 0 0 1px rgba(var(--tc-team-rgb), 0.18),
        0 4px 12px rgba(var(--tc-team-rgb), 0.16);
}
.tc-bar-winner {
    color: rgb(var(--tc-team-rgb)) !important;
    font-weight: 900;
    font-size: 1rem;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* 파스텔 모달 내 연도 필터 버튼 오버라이드 (글로벌 .year-filter-btn은 다크 기준) */
.tc-modal-content .year-filter-btn {
    background: #ffffff;
    color: var(--tc-ink-soft);
    border: 1px solid var(--tc-border);
    box-shadow: 0 1px 3px rgba(60, 80, 130, 0.06);
}
.tc-modal-content .year-filter-btn.active,
.tc-modal-content .year-filter-btn:hover {
    background: linear-gradient(180deg, #fff6e4, #fdecd1);
    color: var(--tc-gold);
    border-color: rgba(201, 138, 46, 0.35);
}

/* ── 경기별 맞대결 카드 리스트 ─────────────────────────── */
.tc-matches-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.tc-matches-count {
    font-size: 0.72rem;
    color: var(--tc-ink-soft);
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
    background: #f2f5fa;
    border: 1px solid var(--tc-border-soft);
}
.tc-matches-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 340px;
    overflow-y: auto;
}
.tc-matches-empty {
    text-align: center;
    color: var(--tc-ink-muted);
    padding: 22px 0;
    font-size: 0.88rem;
}
.tc-match-card {
    display: grid;
    grid-template-columns: 88px 1fr 56px;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: linear-gradient(180deg, #ffffff, #fafaff);
    border: 1px solid var(--tc-border-soft);
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(60, 80, 130, 0.05);
    animation: tc-bar-in 0.45s ease-out both;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.tc-match-card:hover {
    transform: translateY(-1px);
    border-color: rgba(74, 130, 199, 0.3);
    box-shadow: 0 6px 14px rgba(60, 80, 130, 0.10);
}
.tc-match-card.tc-match-w { border-left: 3px solid var(--tc-mint); }
.tc-match-card.tc-match-d { border-left: 3px solid #9fa9b8; }
.tc-match-card.tc-match-l { border-left: 3px solid var(--tc-rose); }

.tc-match-date {
    font-size: 0.78rem;
    color: var(--tc-ink-soft);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.3px;
}
.tc-match-body {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.tc-match-team {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.tc-match-team-home { text-align: right; align-items: flex-end; }
.tc-match-team-away { text-align: left; }
.tc-match-team-name {
    font-size: 0.88rem;
    color: var(--tc-ink);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.tc-match-scorers {
    font-size: 0.72rem;
    color: var(--tc-ink-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 4px 6px;
    justify-content: inherit;
}
.tc-match-team-home .tc-match-scorers { justify-content: flex-end; }
.tc-scorer {
    white-space: nowrap;
    padding: 1px 6px;
    background: #f5f7fb;
    border: 1px solid var(--tc-border-soft);
    border-radius: 8px;
    color: var(--tc-ink-soft);
}
.tc-scorer-empty { color: #c0cad8; font-size: 0.7rem; }
.tc-match-score {
    display: flex;
    align-items: center;
    gap: 6px;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    color: var(--tc-ink);
    font-size: 1.15rem;
    padding: 4px 12px;
    border-radius: 8px;
    background: linear-gradient(180deg, #fff6e4, #fdecd1);
    border: 1px solid rgba(201, 138, 46, 0.25);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}
.tc-match-score-sep { color: var(--tc-gold); }
.tc-match-result {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 900;
    font-size: 0.95rem;
    color: #fff;
    justify-self: end;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 2px 6px rgba(60,80,130,0.18);
}
.tc-match-result-w { background: linear-gradient(145deg, #7ed0a3, var(--tc-mint)); }
.tc-match-result-d { background: linear-gradient(145deg, #bac4d2, #94a0b4); }
.tc-match-result-l { background: linear-gradient(145deg, #ff9a9d, var(--tc-rose)); }

@media (max-width: 680px) {
    .tc-match-card { grid-template-columns: 70px 1fr 36px; padding: 8px; gap: 6px; }
    .tc-match-score { font-size: 1rem; padding: 3px 8px; }
    .tc-match-result { width: 30px; height: 30px; font-size: 0.82rem; }
    .tc-match-team-name { font-size: 0.8rem; }
}

/* ── 리그 순위 비교 패널 ─────────────────────────────── */
.tc-rank-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.tc-rank-scope {
    font-size: 0.72rem;
    color: var(--tc-ink-soft);
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
    background: #f2f5fa;
    border: 1px solid var(--tc-border-soft);
    letter-spacing: 0.3px;
}
.tc-rank-matches-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}
@media (max-width: 760px) {
    .tc-rank-matches-grid { grid-template-columns: 1fr; }
}
.tc-rank-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tc-rank-empty {
    text-align: center;
    color: var(--tc-ink-muted);
    padding: 22px 0;
    font-size: 0.88rem;
}
.tc-rank-row {
    display: grid;
    grid-template-columns: 1fr 160px 1fr;
    align-items: center;
    gap: 10px;
    padding: 8px 4px;
    border-bottom: 1px solid var(--tc-border-soft);
    animation: tc-bar-in 0.4s ease-out both;
}
.tc-rank-row:last-child { border-bottom: none; }

.tc-rank-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #f7f9fc;
    border: 1px solid var(--tc-border-soft);
    transition: all 0.2s;
}
.tc-rank-cell-a { justify-content: flex-end; flex-direction: row-reverse; }
.tc-rank-cell-b { justify-content: flex-start; }
.tc-rank-cell.tc-rank-winner {
    background: linear-gradient(180deg, #fff6e4, #fdecd1);
    border-color: rgba(201, 138, 46, 0.35);
    box-shadow: 0 2px 8px rgba(201, 138, 46, 0.12);
}

.tc-rank-val {
    font-size: 1rem;
    font-weight: 800;
    color: var(--tc-ink);
    font-variant-numeric: tabular-nums;
    min-width: 52px;
    text-align: center;
}
.tc-rank-winner .tc-rank-val {
    color: var(--tc-gold);
    text-shadow: 0 1px 2px rgba(201, 138, 46, 0.25);
}

.tc-rank-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 8px;
    white-space: nowrap;
    letter-spacing: 0.2px;
}
.tc-rank-tone-gold {
    background: linear-gradient(145deg, #fff6e4, #fdecd1);
    color: var(--tc-gold);
    border: 1px solid rgba(201, 138, 46, 0.35);
    box-shadow: 0 0 8px rgba(201, 138, 46, 0.15);
}
.tc-rank-tone-mint {
    background: linear-gradient(145deg, #e4f7ed, #c9eed9);
    color: #2d8f62;
    border: 1px solid rgba(61, 196, 122, 0.28);
}
.tc-rank-tone-rose {
    background: linear-gradient(145deg, #ffe5e7, #ffd0d4);
    color: #b53a3f;
    border: 1px solid rgba(226, 78, 78, 0.28);
}
.tc-rank-tone-neutral {
    background: #eef1f7;
    color: var(--tc-ink-soft);
    border: 1px solid var(--tc-border-soft);
}
.tc-rank-tone-na {
    background: #f4f4f7;
    color: #a0a8b6;
    border: 1px dashed #c8ccd4;
    font-style: italic;
}

.tc-rank-metric {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.tc-rank-metric-name {
    font-size: 0.78rem;
    color: var(--tc-ink);
    font-weight: 700;
    letter-spacing: 0.3px;
}
.tc-rank-metric-dir {
    font-size: 0.75rem;
    color: var(--tc-ink-muted);
    font-weight: 700;
}

@media (max-width: 720px) {
    .tc-rank-row { grid-template-columns: 1fr 120px 1fr; }
    .tc-rank-cell { padding: 5px 7px; gap: 5px; }
    .tc-rank-val { font-size: 0.88rem; min-width: 42px; }
    .tc-rank-badge { font-size: 0.62rem; padding: 2px 6px; }
    .tc-rank-metric-name { font-size: 0.7rem; }
}

/* ── 폼 + 스파크라인 (B) ─────────────────────────────── */
.tc-form-team-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 0;
    border-bottom: 1px solid var(--tc-border-soft);
}
.tc-form-team-row:last-of-type { border-bottom: none; }
.tc-form-team-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.tc-form-team-name {
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.3px;
}
.tc-form-badges {
    display: flex;
    gap: 5px;
}
.tc-form-spark-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.tc-form-spark {
    flex: 0 0 160px;
    max-width: 160px;
    height: 38px;
}
.tc-form-ppg {
    font-size: 0.82rem;
    color: var(--tc-ink-soft);
    font-weight: 600;
}
.tc-form-ppg strong {
    color: var(--tc-ink);
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
}
.tc-form-trend {
    font-size: 1.25rem;
    font-weight: 900;
    padding: 2px 10px;
    border-radius: 10px;
}
.tc-form-trend-up   { color: var(--tc-mint); background: #e4f7ed; border: 1px solid rgba(61,196,122,0.28); }
.tc-form-trend-down { color: var(--tc-rose); background: #ffe5e7; border: 1px solid rgba(226,78,78,0.28); }
.tc-form-trend-flat { color: var(--tc-ink-muted); background: #eef1f7; border: 1px solid var(--tc-border-soft); }

/* ── 선제득점 카드 (D) ────────────────────────────────── */
.tc-first-goal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.tc-fg-card {
    background: linear-gradient(180deg, #ffffff, #fafaff);
    border: 1px solid var(--tc-border-soft);
    border-left: 4px solid var(--tc-fg-color, #4a82c7);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(60, 80, 130, 0.06);
}
.tc-fg-team {
    font-size: 1rem;
    font-weight: 800;
    color: var(--tc-ink);
    letter-spacing: 0.3px;
}
.tc-fg-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: center;
}
.tc-fg-row-label {
    font-size: 0.78rem;
    color: var(--tc-ink-soft);
    font-weight: 700;
    white-space: nowrap;
}
.tc-fg-row-val {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.tc-fg-pct {
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--tc-ink);
    font-variant-numeric: tabular-nums;
}
.tc-fg-sub {
    font-size: 0.72rem;
    color: var(--tc-ink-muted);
    font-weight: 600;
}
.tc-fg-meta {
    font-size: 0.78rem;
    color: var(--tc-ink-soft);
    padding-top: 6px;
    border-top: 1px solid var(--tc-border-soft);
}
.tc-fg-meta strong {
    color: var(--tc-gold);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.tc-fg-empty, .tc-fg-na, .tc-fg-na-text {
    color: var(--tc-ink-muted);
    font-style: italic;
}
.tc-fg-na {
    text-align: center;
    padding: 20px 0;
}
@media (max-width: 720px) {
    .tc-first-goal-grid { grid-template-columns: 1fr; }
}

/* ── 모델 파라미터 패널 (pred-model-panel) ── */
#pred-model-panel {
    margin: 12px 0 0;
}
.pmp-wrap {
    background: rgba(14,22,44,0.85);
    border: 1px solid rgba(100,160,255,0.18);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.35);
}
.pmp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    cursor: pointer;
    background: rgba(20,35,70,0.7);
    border-bottom: 1px solid rgba(100,160,255,0.10);
    user-select: none;
    transition: background 0.15s ease;
}
.pmp-header:hover { background: rgba(30,50,100,0.75); }
.pmp-title-row {
    display: flex;
    align-items: center;
    gap: 7px;
}
.pmp-icon { font-size: 1rem; }
.pmp-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #a0c8ff;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.pmp-accuracy {
    display: flex;
    gap: 6px;
    align-items: center;
}
.pmp-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 99px;
    background: rgba(255,255,255,0.07);
    color: #8ab0d8;
    border: 1px solid rgba(255,255,255,0.10);
    font-variant-numeric: tabular-nums;
    transition: color 0.2s, border-color 0.2s;
}
.pmp-badge.good { color: #4ade80; border-color: rgba(74,222,128,0.35); }
.pmp-badge.mid  { color: #facc15; border-color: rgba(250,204,21,0.35); }
.pmp-badge.low  { color: #f87171; border-color: rgba(248,113,113,0.35); }
.pmp-chevron {
    font-size: 0.65rem;
    color: #5580a8;
    transition: transform 0.2s ease;
}
.pmp-wrap.open .pmp-chevron { transform: rotate(180deg); }
.pmp-body {
    display: none;
    padding: 14px 16px 12px;
    flex-direction: column;
    gap: 14px;
}
.pmp-wrap.open .pmp-body { display: flex; }
.pmp-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.pmp-label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.pmp-label {
    font-size: 0.72rem;
    color: #8ab0d8;
    font-weight: 600;
}
.pmp-val {
    font-size: 0.78rem;
    font-weight: 800;
    color: #e2f0ff;
    font-variant-numeric: tabular-nums;
    min-width: 36px;
    text-align: right;
}
.pmp-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right, #3b82f6 0%, #3b82f6 var(--pct, 50%), rgba(255,255,255,0.1) var(--pct, 50%));
    outline: none;
    cursor: pointer;
    transition: background 0.1s;
}
.pmp-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #60a5fa;
    border: 2px solid #1e3a6e;
    box-shadow: 0 0 0 2px rgba(96,165,250,0.3);
    transition: transform 0.15s, box-shadow 0.15s;
}
.pmp-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 4px rgba(96,165,250,0.25);
}
.pmp-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #60a5fa;
    border: 2px solid #1e3a6e;
    cursor: pointer;
}
.pmp-footer {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-top: 4px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.pmp-btn-apply {
    flex: 1;
    padding: 7px 0;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    font-size: 0.76rem;
    font-weight: 700;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(37,99,235,0.35);
}
.pmp-btn-apply:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 4px 14px rgba(59,130,246,0.45);
}
.pmp-btn-apply:active { transform: scale(0.97); }
.pmp-btn-reset {
    padding: 7px 12px;
    background: rgba(255,255,255,0.05);
    color: #8ab0d8;
    font-size: 0.73rem;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.pmp-btn-reset:hover {
    background: rgba(255,255,255,0.10);
    color: #c0d8f8;
}
.pmp-hint {
    font-size: 0.65rem;
    color: #3a5880;
    text-align: center;
    padding-top: 6px;
}
.pmp-section-label {
    font-size: 0.62rem;
    font-weight: 700;
    color: #4a6888;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 0 2px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 2px;
}
.pmp-applying {
    opacity: 0.6;
    pointer-events: none;
}





/* ── 골 타이밍 패널 ──────────────────────────────────────── */
.gt-half-labels {
    display: flex;
    gap: 0;
    margin-bottom: 4px;
}
.gt-half-label {
    flex: 1;
    text-align: center;
    font-size: 11px;
    color: #64748b;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.gt-half-label:first-child {
    border-right: 1px dashed rgba(255,255,255,0.12);
    flex: 3;
}
.gt-half-label:last-child { flex: 4; }
.gt-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0 4px;
}
.gt-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 11px;
    color: #64748b;
    min-width: 72px;
}
.gt-stat strong {
    display: block;
    font-size: 17px;
    font-weight: 700;
    color: #e2e8f0;
    margin-top: 3px;
    font-variant-numeric: tabular-nums;
}
.gt-pos { color: #4ade80 !important; }
.gt-neg { color: #f87171 !important; }

/* ── 온보딩 오버레이 ─────────────────────────────────────── */
.ob-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(10, 15, 30, 0.88);
    backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s ease;
}
.ob-overlay.ob-visible  { opacity: 1; }
.ob-overlay.ob-hiding   { opacity: 0; }

.ob-card {
    background: #0f172a;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 36px 40px;
    max-width: 480px; width: 92vw;
    box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}
.ob-header {
    text-align: center;
    margin-bottom: 28px;
}
.ob-logo {
    display: block;
    font-size: 22px; font-weight: 800;
    color: #e94560; letter-spacing: 0.02em;
    margin-bottom: 6px;
}
.ob-tagline {
    font-size: 13px; color: #64748b;
}
.ob-steps {
    display: flex; flex-direction: column; gap: 16px;
    margin-bottom: 28px;
}
.ob-step {
    display: flex; align-items: flex-start; gap: 14px;
}
.ob-num {
    flex-shrink: 0;
    width: 28px; height: 28px;
    background: rgba(233,69,96,0.15);
    border: 1px solid rgba(233,69,96,0.4);
    color: #e94560;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    margin-top: 1px;
}
.ob-step-text { display: flex; flex-direction: column; gap: 3px; }
.ob-step-text strong { font-size: 14px; color: #e2e8f0; font-weight: 600; }
.ob-step-text span   { font-size: 12px; color: #64748b; line-height: 1.5; }
.ob-start-btn {
    width: 100%;
    padding: 13px;
    background: #e94560;
    color: #fff;
    border: none; border-radius: 10px;
    font-size: 15px; font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.ob-start-btn:hover  { background: #c73652; }
.ob-start-btn:active { transform: scale(0.98); }

/* === 예측 사후 분석 카드 =============================================== */
.pred-retro {
    margin-top: 14px;
    padding: 14px 16px;
    background: rgba(18,29,54,0.7);
    border: 1px solid #2a3550;
    border-radius: 10px;
}
.retro-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
}
.retro-title { font-size: 14px; font-weight: 600; color: #e3eaff; }
.retro-verdict {
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 12px; font-weight: 700;
    letter-spacing: 0.02em;
}
.retro-hit  { background: rgba(74,222,128,0.16); color: #4ade80; border: 1px solid rgba(74,222,128,0.35); }
.retro-miss { background: rgba(248,113,113,0.16); color: #f87171; border: 1px solid rgba(248,113,113,0.35); }

.retro-rows {
    display: flex; flex-direction: column; gap: 7px;
    padding: 10px 0; border-top: 1px solid rgba(255,255,255,0.06);
}
.retro-row {
    display: flex; align-items: center; gap: 10px;
    font-size: 12.5px; line-height: 1.4;
}
.rr-label  { min-width: 92px; color: #8a96b8; font-size: 11px; letter-spacing: 0.02em; }
.rr-pred   { color: #c8d2e8; }
.rr-pred em { font-style: normal; color: #7a8aaf; font-size: 11px; }
.rr-arrow  { color: #4a5670; font-size: 11px; }
.rr-actual { color: #fff; font-weight: 600; }
.rr-tag    {
    margin-left: 6px;
    padding: 2px 8px; border-radius: 10px;
    font-size: 10.5px; font-weight: 600;
}
.rr-tag-exact { background: rgba(74,222,128,0.18); color: #4ade80; }
.rr-tag-top3  { background: rgba(251,191,36,0.18); color: #facc15; }
.rr-tag-near  { background: rgba(120,140,180,0.18); color: #aab4cf; }

.retro-pins {
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex; flex-direction: column; gap: 5px;
}
.retro-pin {
    font-size: 12px; color: #c8d2e8;
    padding: 4px 0;
    line-height: 1.4;
}

/* === 전술 보기 (avg_positions + shotmap) ============================== */
.pred-tactics {
    margin-top: 14px;
    padding: 14px 16px;
    background: rgba(18,29,54,0.7);
    border: 1px solid #2a3550;
    border-radius: 10px;
}
.pt-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}
.pt-title-row { display: flex; align-items: center; gap: 8px; }
.pt-title { font-weight: 600; color: #e3eaff; font-size: 14px; }
.pt-fallback-badge {
    font-size: 11px; font-weight: 500;
    color: #f59e0b; background: rgba(245,158,11,0.12);
    border: 1px solid rgba(245,158,11,0.3);
    border-radius: 4px; padding: 1px 7px; letter-spacing: 0.01em;
}
.pt-fallback-badge.pt-fallback-recent {
    color: #818cf8; background: rgba(129,140,248,0.12);
    border-color: rgba(129,140,248,0.3);
}
.pt-filter {
    display: inline-flex; gap: 0; border: 1px solid #2a3550;
    border-radius: 6px; overflow: hidden;
}
.pt-filter-btn {
    padding: 5px 12px; font-size: 11px; font-weight: 500;
    background: transparent; color: #8a96b8; border: none;
    cursor: pointer; transition: background 0.15s, color 0.15s;
    border-right: 1px solid #2a3550;
}
.pt-filter-btn:last-child { border-right: none; }
.pt-filter-btn:hover { background: rgba(255,255,255,0.04); color: #c8d2e8; }
.pt-filter-btn.active {
    background: var(--c, #2a3550);
    color: #fff;
    font-weight: 600;
}
.pt-filter-btn[data-filter="all"].active {
    background: #2a3550; color: #e3eaff;
}
.pt-filter-row {
    display: flex; align-items: center; gap: 12px;
}

/* 선발/교체 토글 (pt-filter와 동일 스타일) */
.pt-mode {
    display: inline-flex; gap: 0; border: 1px solid #2a3550;
    border-radius: 6px; overflow: hidden;
}
.pt-mode-btn {
    padding: 5px 14px; font-size: 11px; font-weight: 500;
    background: transparent; color: #8a96b8; border: none;
    cursor: pointer; transition: background 0.15s, color 0.15s;
    border-right: 1px solid #2a3550;
}
.pt-mode-btn:last-child { border-right: none; }
.pt-mode-btn:hover { background: rgba(255,255,255,0.04); color: #c8d2e8; }
.pt-mode-btn.active {
    background: #2a3550;
    color: #fff;
    font-weight: 600;
}

/* 교체 패널 — 평균 포지션 위 */
.pt-subs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 12px 0 14px;
    padding: 10px 12px;
    background: rgba(8,15,30,0.4);
    border: 1px solid #1f2a44;
    border-radius: 8px;
}
.pt-subs-col { min-width: 0; }
.pt-subs-title {
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}
.pt-subs-empty {
    font-size: 10.5px;
    color: #6a7890;
    padding: 4px 0;
}
.pt-sub-item {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px;
    padding: 3px 0;
    color: #d8e0ee;
    line-height: 1.4;
    flex-wrap: wrap;
}
.pt-sub-min {
    flex-shrink: 0;
    min-width: 32px;
    color: #f59e0b;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.pt-sub-out {
    color: #f87171;
    text-decoration: line-through;
    text-decoration-color: rgba(248,113,113,0.5);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.pt-sub-arrow {
    color: #6a7890;
    flex-shrink: 0;
}
.pt-sub-in {
    color: #4ade80;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.pt-sub-empty {
    color: #4a5670 !important;
    text-decoration: none !important;
    font-weight: 400;
}

.pt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pt-panel {
    position: relative;
    background: rgba(8,15,30,0.5);
    border: 1px solid #1f2a44;
    border-radius: 8px;
    padding: 10px;
}
.pt-panel-title {
    font-size: 12px; color: #aab4cf; margin-bottom: 6px; font-weight: 600;
    letter-spacing: -0.01em;
}
.pt-shotcount { color: #6c7693; font-weight: 400; margin-left: 4px; }
.pt-canvas {
    width: 100%; height: auto; max-height: 340px;
    border-radius: 6px; display: block;
}
.pt-hint { margin-top: 6px; font-size: 10px; color: #6c7693; text-align: center; }
.pt-shot-legend {
    margin-top: 6px; display: flex; flex-wrap: wrap; justify-content: center;
    gap: 10px; font-size: 11px; color: #c8d2e8;
}
.pt-sl { display: inline-flex; align-items: center; gap: 4px; }
.psl-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.psl-goal  { background: #fbbf24; }
.psl-save  { background: #60a5fa; }
.psl-miss  { background: #94a3b8; }
.psl-block { background: #f472b6; }
.psl-post  { background: #f87171; }
.pt-tooltip {
    position: absolute; pointer-events: none;
    background: #0f1729; color: #e3eaff;
    border: 1px solid #2a3550; border-radius: 6px;
    padding: 6px 10px; font-size: 11px; line-height: 1.4;
    box-shadow: 0 4px 14px rgba(0,0,0,0.4);
    z-index: 10;
}
@media (max-width: 980px) {
    .pt-grid { grid-template-columns: 1fr; }
}
/* ── 정보 계층 재설계 (2026-05-14, v2 톤다운) ────────────── */
/* 흐름 단계 헤더 — 미니멀: 작은 모노톤 + 부드러운 라벨 */
.flow-section-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 4px;
    padding: 0 16px;
    opacity: 0.65;
    transition: opacity 0.2s;
}
.flow-section-head:hover { opacity: 1; }
.flow-section-head.flow-section-head-mid { margin: 18px 0 4px; }
.flow-step {
    display: inline-block;
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    background: none;
    box-shadow: none;
    border-radius: 0;
    min-width: auto;
    height: auto;
}
.flow-title {
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.005em;
}
.flow-hint {
    color: rgba(255, 255, 255, 0.32);
    font-size: 11px;
    margin-left: 4px;
    font-weight: 400;
}

/* 인사이트 접기 (⑤ 단계) */
#insights-section.insights-collapsed .ld-header,
#insights-section.insights-collapsed #insights-grid {
    display: none;
}
.insights-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: linear-gradient(180deg, rgba(37, 83, 165, 0.18) 0%, rgba(15, 25, 45, 0.6) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #f5f5f5;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    margin: 12px 16px 4px;
}
.insights-toggle:hover {
    background: linear-gradient(180deg, rgba(37, 83, 165, 0.28) 0%, rgba(15, 25, 45, 0.7) 100%);
    border-color: rgba(255, 255, 255, 0.18);
}
.insights-toggle:focus-visible {
    outline: 2px solid #4a86e8;
    outline-offset: 2px;
}
.insights-toggle-label {
    flex: 1;
    text-align: left;
}
.insights-toggle-arrow {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    transition: transform 0.2s;
}
#insights-section:not(.insights-collapsed) .insights-toggle-arrow {
    transform: rotate(180deg);
}

/* 헤더 정확도 배너 — 예측 섹션 상단 (prediction-section 안에서만 표시) */
.header-accuracy-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    margin: 0 0 8px;
    background: linear-gradient(90deg, rgba(15, 25, 45, 0.55) 0%, rgba(37, 83, 165, 0.15) 100%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
}
.header-accuracy-bar:empty { display: none; }
.hab-lead {
    font-weight: 700;
    color: #c8d2e8;
    letter-spacing: -0.005em;
}
.hab-league {
    display: inline-flex; align-items: center; gap: 6px;
}
.hab-name {
    color: #fbf500;
    font-weight: 700;
    font-size: 11px;
    padding: 1px 6px;
    background: rgba(251, 245, 0, 0.12);
    border-radius: 4px;
}
.hab-stat { color: rgba(255, 255, 255, 0.92); }
.hab-stat.hab-na { color: rgba(255, 255, 255, 0.4); font-style: italic; }
.hab-v { font-weight: 700; color: #7bed9f; }
.hab-k {
    color: rgba(255, 255, 255, 0.55);
    font-size: 10px;
    margin-left: 1px;
    font-weight: 500;
}
.hab-n {
    color: rgba(255, 255, 255, 0.45);
    font-size: 11px;
    font-weight: 400;
}
.hab-sep { color: rgba(255, 255, 255, 0.2); }
.hab-sub {
    margin-left: auto;
    color: rgba(255, 255, 255, 0.35);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.02em;
}
@media (max-width: 720px) {
    .header-accuracy-bar { flex-direction: column; align-items: flex-start; gap: 6px; }
    .hab-sub { margin-left: 0; }
    .hab-sep { display: none; }
}

/* CSV export 버튼 (retroCard 헤더) */
.retro-export {
    margin-left: auto;
    padding: 4px 10px;
    background: rgba(123, 237, 159, 0.12);
    border: 1px solid rgba(123, 237, 159, 0.3);
    border-radius: 6px;
    color: #7bed9f;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.retro-export:hover {
    background: rgba(123, 237, 159, 0.22);
    border-color: rgba(123, 237, 159, 0.5);
}
.retro-export:focus-visible {
    outline: 2px solid #7bed9f; outline-offset: 2px;
}

/* ── 모바일 가시성 작업 (2026-05-14) ───────────────────── */
/* 핵심: ≤768px에서 데스크탑 좌측 툴바 → 상단 가로 스크롤 띠 전환 + 정보 컴팩트화 */

@media (max-width: 768px) {
    body { overflow-y: auto; }
    #app { height: auto; min-height: 100vh; }

    /* 헤더 정확도 배너 — 작게 */
    .header-accuracy-bar {
        padding: 8px 12px;
        margin: 6px 8px 0;
        font-size: 11px;
        gap: 6px;
    }
    .hab-lead { font-size: 11px; }
    .hab-name { font-size: 10px; padding: 1px 5px; }

    /* 단계 헤더 — 컴팩트 */
    .flow-section-head { margin: 10px 0 4px; padding: 0 10px; gap: 6px; }
    .flow-section-head.flow-section-head-mid { margin: 14px 0 4px; }
    .flow-step { font-size: 10px; }
    .flow-title { font-size: 12px; }
    .flow-hint { display: none; }  /* 모바일에서 안내문 숨김 — 단계명만 */

    /* 인사이트 토글 — 작게 */
    .insights-toggle { padding: 10px 14px; font-size: 13px; margin: 8px 10px 4px; }

    /* 매치 카드 (.kmc) — 좁은 폭 컴팩트 */
    .ksb-banner { padding: 8px; }
    .ksb-header { gap: 6px; }
    .ksb-title { font-size: 12px; }
    .ksb-sub { font-size: 10px; }
    .ksb-round-tabs { gap: 4px; }
    .ksb-round-btn { padding: 4px 6px; font-size: 11px; }
    .ksb-round-done { font-size: 9px; }
    .kmc { padding: 6px 8px; gap: 6px; }
    .kmc-name { font-size: 11px; }
    .kmc-score { font-size: 14px; }
    .kmc-time { font-size: 11px; }
    .kmc-emb { width: 22px; height: 22px; }
    .kmc-meta { font-size: 9px; }
    .kmc-tag { font-size: 9px; padding: 1px 4px; }

    /* 메인 전술판 영역 — column 전환 (600px → 768px 상향) */
    #main-row { flex-direction: column; }
    #main-area { flex-direction: column; padding: 8px; gap: 8px; }
    #canvas-container { flex-direction: column; }

    /* 좌측 툴바 → 상단 가로 스크롤 띠 */
    #left-toolbar {
        width: 100% !important;
        flex-direction: row !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 6px;
        padding: 6px 8px;
        border-radius: 8px;
        align-self: stretch;
        scrollbar-width: thin;
    }
    #left-toolbar::-webkit-scrollbar { height: 4px; }
    #left-toolbar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }
    .ltb-group {
        flex-direction: row !important;
        flex-shrink: 0;
        gap: 3px;
    }
    .ltb-grid2 {
        display: flex !important;
        flex-direction: row !important;
        grid-template-columns: none !important;
    }
    .ltb-divider {
        width: 1px;
        height: 24px;
        background: rgba(255,255,255,0.1);
        margin: 0 4px;
        flex-shrink: 0;
    }
    .ltb-speed { width: auto; min-width: 120px; }
    .ltb-speed-row { flex-direction: row !important; }
    .ltb-label { font-size: 10px; }
    #left-toolbar .mode-btn,
    #left-toolbar .action-btn {
        padding: 4px 8px;
        font-size: 10px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .color-swatches {
        flex-direction: row !important;
        gap: 3px;
        align-items: center;
    }

    /* 벤치 패널 — 가로 배치 (이미 ≤600px 처리, 768px도 적용) */
    #bench-panel {
        width: 100%;
        flex-direction: row;
        border-left: none;
        border-top: 1px solid var(--bg-elevated);
        height: 140px;
    }
    .bench-section { flex-direction: row; border-bottom: none; border-right: 1px solid var(--bg-elevated); }
    .bench-section:last-child { border-right: none; }
    .bench-header { flex-direction: column; gap: 4px; align-items: flex-start; }
    .bench-players { max-height: 90px; font-size: 11px; }

    /* 예측 보고서 — padding 줄이기 */
    #prediction-section { padding: 10px; }
    .pred-extras { gap: 8px; }
    .pred-retro { padding: 10px; }
    .retro-header { gap: 6px; flex-wrap: wrap; }
    .retro-title { font-size: 13px; }
    .retro-export { font-size: 10px; padding: 3px 8px; }
    .retro-row { font-size: 11px; gap: 6px; flex-wrap: wrap; }

    /* 인사이트 그리드 — 모바일 간격 축소 (이미 세로 스택) */
    #insights-grid { gap: 12px; }
}

@media (max-width: 480px) {
    /* 매우 좁은 폭 — 추가 압축 */
    .ksb-list { gap: 4px; }
    .kmc { flex-direction: row; padding: 5px 6px; }
    .kmc-side { padding: 0 4px; }
    .kmc-name { font-size: 10px; }
    .header-accuracy-bar { font-size: 10px; padding: 6px 10px; }
    .hab-stat .hab-k { display: none; }  /* "1X2", "정확" 라벨 숨김, 숫자만 */
}

/* 매치 URL 공유 버튼 */
.retro-share {
    margin-left: auto;
    padding: 4px 10px;
    background: rgba(96, 165, 250, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 6px;
    color: #60a5fa;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.retro-share:hover {
    background: rgba(96, 165, 250, 0.22);
    border-color: rgba(96, 165, 250, 0.5);
}
.retro-share-ok {
    background: rgba(123, 237, 159, 0.22) !important;
    border-color: rgba(123, 237, 159, 0.5) !important;
    color: #7bed9f !important;
}
.retro-export { margin-left: 0 !important; }

/* 즐겨찾기 별표 + 카드 강조 */
.kmc-fav-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.15s, transform 0.15s;
    user-select: none;
    line-height: 1;
}
.kmc-fav-btn:hover {
    color: #fbbf24;
    transform: scale(1.15);
}
.kmc-side-fav .kmc-fav-btn {
    color: #fbbf24;
}
.kmc-fav {
    border-left: 3px solid #fbbf24;
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.18);
}
.kmc-fav .kmc-name {
    color: #fff;
    font-weight: 700;
}

/* 시즌 시뮬레이션 미니 위젯 (인사이트 섹션 상단) */
.season-sim-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 8px 18px;
    margin: 0 0 8px;
    background: linear-gradient(90deg, rgba(15, 25, 45, 0.45) 0%, rgba(96, 165, 250, 0.08) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
}
.season-sim-bar:empty { display: none; }
.ssb-lead {
    font-weight: 700; color: #c8d2e8;
    letter-spacing: -0.005em;
}
.ssb-league {
    display: inline-flex; align-items: center; gap: 8px;
    flex-wrap: wrap;
}
.ssb-name {
    color: #fbf500; font-weight: 700;
    padding: 1px 6px;
    background: rgba(251, 245, 0, 0.12);
    border-radius: 4px;
    font-size: 10px;
}
.ssb-sub {
    color: rgba(255, 255, 255, 0.4);
    font-size: 10px;
}
.ssb-champ {
    font-weight: 700;
    color: #fbbf24;
}
.ssb-afc {
    color: #c8d2e8;
    font-size: 10px;
}
.ssb-rel {
    color: #f87171;
    font-size: 10px;
}
.ssb-divider { color: rgba(255, 255, 255, 0.15); }
.ssb-empty {
    color: rgba(255, 255, 255, 0.35);
    font-style: italic;
}
@media (max-width: 768px) {
    .season-sim-bar { gap: 6px; padding: 6px 12px; font-size: 10px; flex-direction: column; align-items: flex-start; }
    .ssb-league { gap: 6px; font-size: 10px; }
    .ssb-divider { display: none; }
}

/* ══════════════════════════════════════════════════════════════
   레이아웃 그리드 — Analytics · PlayerAnalytics · PlayerReport
══════════════════════════════════════════════════════════════ */

/* Analytics 패널 2-col (차트 | 테이블) */
.an-panel-grid {
    display: grid;
    grid-template-columns: 58% 1fr;
    gap: 16px;
    align-items: start;
}
.an-panel-grid .chart-wrap { height: 300px; }
.an-panel-grid .analytics-table-wrap {
    max-height: 340px;
    overflow-y: auto;
    overflow-x: hidden;
}
/* Analytics 날씨 3-col */
.an-weather-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.an-weather-block {
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 14px 12px;
}
.an-weather-block .analytics-section-label {
    margin: 0 0 8px;
    font-size: 11px;
    color: #9aafcc;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.an-weather-block .chart-wrap { height: 180px; }
@media (max-width: 760px) {
    .an-panel-grid { grid-template-columns: 1fr; }
    .an-weather-grid { grid-template-columns: 1fr; }
}

/* 경기별 트렌드 */
.pa-trend-wrap {
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

/* Player analytics 하단 2-col (활동량 | 월별) */
.pa-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.pa-bottom-grid .pa-activity-wrap,
.pa-bottom-grid .pa-monthly-wrap {
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 16px;
    min-width: 0;
}
@media (max-width: 680px) {
    .pa-bottom-grid { grid-template-columns: 1fr; }
}

/* Player report 하단 2-col (상대팀 | 활동량) */
.pr-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 700px) {
    .pr-bottom-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════
   v46 UX 편의성 개선 패치
   ═══════════════════════════════════════════════════════ */

/* ── 1. 데이터 신선도 배지 ── */
.data-freshness-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 3px 10px;
    margin-left: 16px;
    white-space: nowrap;
    transition: color var(--trans-fast);
}
.data-freshness-badge .dfb-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
}
.data-freshness-badge.dfb-old .dfb-dot { background: #f59e0b; }
.data-freshness-badge.dfb-error .dfb-dot { background: #ef4444; }

/* ── 2. 온보딩 개선 — "다시 보기" 링크 ── */
.ob-reset-link {
    display: block;
    text-align: center;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-faint);
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px;
}
.ob-reset-link:hover { color: var(--text-muted); text-decoration: underline; }

/* ── 3. 히트맵 선수 검색 ── */
.k2-search-wrap {
    padding: 8px 0 4px;
    position: sticky;
    top: 0;
    background: var(--bg-surface);
    z-index: 10;
}
.k2-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px 8px 32px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-base);
    outline: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 10px center;
    transition: border-color var(--trans-fast);
}
.k2-search-input:focus { border-color: var(--accent); }
.k2-search-input::placeholder { color: var(--text-faint); }

/* ── 4. 활동량 지수 툴팁 ── */
.tt-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px; height: 15px;
    border-radius: 50%;
    border: 1px solid var(--text-faint);
    color: var(--text-faint);
    font-size: 10px;
    font-weight: 700;
    cursor: help;
    margin-left: 5px;
    position: relative;
    vertical-align: middle;
}
.tt-help:hover { border-color: var(--accent); color: var(--accent); }
.tt-help-tip {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    background: #0d1525;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.6;
    z-index: 200;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.tt-help:hover .tt-help-tip { display: block; }
.tt-help-tip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--border-subtle);
}

/* ── 5. 예측→전술판 CTA ── */
.pred-goto-tactic {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    margin-top: 16px;
    background: linear-gradient(135deg, #1a3a6b, #0f2d52);
    border: 1px solid rgba(37,99,235,0.4);
    border-radius: 10px;
    color: #93c5fd;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--trans-base);
    text-decoration: none;
}
.pred-goto-tactic:hover {
    background: linear-gradient(135deg, #1e4080, #1a3670);
    border-color: rgba(37,99,235,0.7);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(37,99,235,0.3);
}
.pred-goto-tactic .pgt-icon { font-size: 18px; }
.pred-goto-tactic .pgt-sub {
    font-size: 11px;
    color: #60a5fa;
    font-weight: 400;
    margin-top: 1px;
}

/* ── 6. 라인업 불러오기 글로우 (경기 선택 시) ── */
@keyframes match-load-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(233,69,96,0); }
    50%       { box-shadow: 0 0 0 5px rgba(233,69,96,0.35); }
}
.match-load-glow {
    animation: match-load-pulse 2s ease-in-out infinite;
    border-color: var(--accent) !important;
    color: var(--accent) !important;
}

/* ── 7. 히트맵 선수 컨텍스트 배너 ── */
.k2-player-context {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}
.k2-ctx-pill {
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    white-space: nowrap;
}
.k2-ctx-pill.pos-g { color: #fbbf24; }
.k2-ctx-pill.pos-d { color: #60a5fa; }
.k2-ctx-pill.pos-m { color: #34d399; }
.k2-ctx-pill.pos-f { color: #f87171; }

/* ── 8. PA 로딩 skeleton 개선 ── */
.pa-loading-skeleton {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
}
.pa-skel-row {
    height: 14px;
    border-radius: 4px;
}
.pa-skel-row.w80 { width: 80%; }
.pa-skel-row.w60 { width: 60%; }
.pa-skel-row.w40 { width: 40%; }
.pa-skel-chart {
    height: 180px;
    border-radius: 8px;
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════
   작업공간 탭 (전술판 / 경기예측 / 팀 / 선수)
   롱스크롤+모달 → 상위 탭 IA. 선택 매치는 탭바 위 스트립에 상주.
   ═══════════════════════════════════════════════════════ */
#workspace-tabs {
    display: flex;
    gap: 6px;
    margin: 14px 0 12px;
    padding: 5px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    position: sticky;
    top: 0;
    z-index: 40;
}
.ws-tab {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 14px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.ws-tab .ws-tab-icon { font-size: 1.05rem; line-height: 1; }
.ws-tab:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}
.ws-tab:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.ws-tab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 2px 10px var(--accent-glow);
}
.ws-tab.active .ws-tab-label { font-weight: 700; }

/* 탭 패널 */
.ws-panel { display: block; }
.ws-panel.hidden { display: none; }

/* 인라인된 모달/오버레이/드로어를 패널 안에서는 정적 블록으로 전환
   (position:fixed·backdrop·중앙정렬 해제) */
.ws-panel .modal {
    position: static;
    inset: auto;
    z-index: auto;
    display: block;
}
.ws-panel .modal.hidden { display: none; }
.ws-panel .modal-backdrop { display: none; }
.ws-panel .modal-content {
    position: static;
    width: auto;
    max-width: none;
    max-height: none;
    border: none;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}
/* 인라인 시 모달 내부 "닫기" 버튼은 불필요(탭이 가시성 관리) */
.ws-panel .modal-content > .analytics-header #analytics-close,
.ws-panel #tc-close { display: none; }

/* 팀 선택 통합: 팀 분석 자체 드롭다운 숨김(팀 비교의 팀 A가 구동) */
.ws-panel #analytics-team-select { display: none; }
/* 팀 탭 상단 안내 */
.ws-team-hint {
    margin: 2px 2px 14px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 9px;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}
.ws-team-hint strong { color: var(--text-primary); font-weight: 700; }

/* 팀 비교 패널 — 카테고리별 컬러 코딩 (좌측 accent 보더 + 헤더 색) */
#tc-body .tc-panel {
    border-left: 3px solid var(--tc-accent, var(--border-subtle));
    box-shadow: inset 2px 0 0 -1px var(--tc-accent, transparent), 0 1px 3px rgba(0,0,0,0.25);
    transition: border-color 0.2s ease;
}
#tc-body .tc-panel .tc-panel-label {
    color: var(--tc-accent, var(--text-secondary));
    letter-spacing: -0.01em;
}
/* 강원/광주 등 데이터 색과 헤더 색이 충돌하지 않도록 라벨만 accent, 본문 텍스트는 기존 유지 */

/* H2H 맞대결 — 득점 시간 표시 */
.tc-scorer-min { color: var(--text-faint); font-variant-numeric: tabular-nums; font-size: 0.92em; }
.tc-scorer-tag {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 3px;
    vertical-align: middle;
}
.tc-scorer-pk { background: rgba(96,165,250,0.2); color: #93c5fd; }
.tc-scorer-og { background: rgba(248,113,113,0.2); color: #fca5a5; }

/* 골 타이밍 비교 (두 팀 · 득점/실점 2분할) */
.tc-gt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tc-gt-block { min-width: 0; }
.tc-gt-sub { margin: 0 0 6px; font-size: 0.85rem; color: var(--text-secondary); font-weight: 600; }
@media (max-width: 760px) { .tc-gt-grid { grid-template-columns: 1fr; } }

/* 탭 도입으로 중복된 단계 라벨(④ 전술판) 및 bench 내 분석 버튼 숨김
   (#btn-analytics/#btn-team-compare는 팀 탭 onShow에서 프로그램적으로만 사용) */
.flow-section-head-mid { display: none; }
#analytics-widget-area { display: none; }

@media (max-width: 720px) {
    .ws-tab { padding: 9px 8px; font-size: 0.85rem; }
    .ws-tab .ws-tab-label { display: none; }  /* 좁은 화면: 아이콘만 */
}

/* 매치 선택 스트립 접기 토글 */
.match-strip-toggle {
    margin-left: auto;
    padding: 5px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 7px;
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.match-strip-toggle:hover { background: var(--bg-elevated); color: var(--text-primary); }
.match-strip-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* 접힘 상태: 라운드 일정 그리드 숨김(선택 후 세로 공간 회복) */
body.match-strip-collapsed #league-schedule-wrap { display: none; }

/* ═══════════════════════════════════════════════════════
   팀 비교 — 다크 테마 전환 (라이트 모달 → 다크 탭 인라인 일관화)
   team_compare는 원래 라이트 모달이라 흰 카드/어두운 텍스트였음.
   작업공간 탭(다크)에 인라인되니 이질적 → 테마 변수 + 하드코딩 배경을 다크로 오버라이드.
   (차트 텍스트색은 team_compare.js에서 별도 변경)
   ═══════════════════════════════════════════════════════ */
.ws-panel .tc-modal-content {
    --tc-ink:         #e2e8f0;
    --tc-ink-soft:    #aab6c9;
    --tc-ink-muted:   #8492a8;
    --tc-border:      rgba(255, 255, 255, 0.10);
    --tc-border-soft: rgba(255, 255, 255, 0.055);
    --tc-card:        #16213e;
    color: var(--tc-ink);
}
/* 흰 인셋 하이라이트 제거 + 패널 다크 */
.ws-panel #tc-body .tc-panel { box-shadow: inset 2px 0 0 -1px var(--tc-accent, transparent), 0 4px 14px rgba(0,0,0,0.30); }
/* 하드코딩 라이트 배경 → 다크 */
.ws-panel .tc-team-select { background: #0f1b33; }
.ws-panel .tc-team-select option { background: #16213e; color: #e2e8f0; }
.ws-panel .tc-title-row {
    background:
        radial-gradient(ellipse 60% 120% at 0% 50%, var(--tc-color-a, rgba(74,130,199,0.22)) 0%, transparent 55%),
        radial-gradient(ellipse 60% 120% at 100% 50%, var(--tc-color-b, rgba(224,109,79,0.22)) 0%, transparent 55%),
        linear-gradient(180deg, #18233f, #131d35);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.ws-panel .tc-h2h-summary {
    background: linear-gradient(180deg, rgba(201,138,46,0.20), rgba(201,138,46,0.08));
    box-shadow: none;
}
.ws-panel .tc-ha-pct { background: rgba(255,255,255,0.06); }
.ws-panel .tc-matches-count { background: rgba(255,255,255,0.07); }
.ws-panel .tc-match-card { background: linear-gradient(180deg, #18233f, #131d35); }
.ws-panel .tc-scorer { background: rgba(255,255,255,0.06); }
.ws-panel .tc-match-score { background: linear-gradient(180deg, rgba(201,138,46,0.18), rgba(201,138,46,0.07)); }
/* 우위 숫자 — 어두운 팀 색이면 다크 배경에서 안 보이던 문제 → 흰색 고정(식별은 막대/글로우가 담당) */
.ws-panel .tc-bar-winner { text-shadow: none; color: #ffffff !important; }
.ws-panel .tc-modal-content .year-filter-btn { background: #16213e; color: var(--tc-ink-soft); box-shadow: none; }
.ws-panel .tc-modal-content .year-filter-btn.active,
.ws-panel .tc-modal-content .year-filter-btn:hover {
    background: linear-gradient(180deg, rgba(201,138,46,0.22), rgba(201,138,46,0.10));
    color: var(--tc-gold);
}
/* 선제득점/선제실점 카드 — 하드코딩 흰 배경 → 다크 (밝은 텍스트가 묻히던 문제 해결) */
.ws-panel .tc-fg-card {
    background: linear-gradient(180deg, #18233f, #131d35);
    box-shadow: 0 4px 14px rgba(0,0,0,0.30);
}
.ws-panel .tc-fg-meta strong { color: var(--tc-gold); }

/* 리그 순위 비교 — 라이트 셀/배지 잔재 → 다크. 밝은 셀에 밝은 값 텍스트가 묻히던 문제 해결 */
.ws-panel .tc-rank-cell {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.07);
}
.ws-panel .tc-rank-cell.tc-rank-winner {
    background: linear-gradient(180deg, rgba(201,138,46,0.20), rgba(201,138,46,0.08));
    border-color: rgba(201,138,46,0.38);
    box-shadow: 0 2px 10px rgba(201,138,46,0.14);
}
/* 순위 배지 톤 — 라이트 배경 → 다크 틴트(텍스트 대비 확보) */
.ws-panel .tc-rank-tone-gold    { background: rgba(201,138,46,0.18); color: #f0c75e; border-color: rgba(201,138,46,0.40); box-shadow: none; }
.ws-panel .tc-rank-tone-mint    { background: rgba(61,196,122,0.16); color: #6fe3a4; border-color: rgba(61,196,122,0.35); }
.ws-panel .tc-rank-tone-rose    { background: rgba(226,78,78,0.16);  color: #ff9ea2; border-color: rgba(226,78,78,0.35); }
.ws-panel .tc-rank-tone-neutral { background: rgba(255,255,255,0.06); color: var(--tc-ink-soft); border-color: rgba(255,255,255,0.10); }
.ws-panel .tc-rank-tone-na      { background: rgba(255,255,255,0.035); color: #8492a8; border-color: rgba(255,255,255,0.12); }
