/* ═══════════════════════════════════════════════════════
   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;
}

/* 자동 업데이트 위젯 */
#auto-update-widget {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.72rem;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 4px 10px 4px 8px;
}
.auw-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background 0.3s;
}
.auw-idle    { background: #4b5563; }
.auw-ok      { background: #22c55e; box-shadow: 0 0 6px #22c55e88; }
.auw-error   { background: #ef4444; box-shadow: 0 0 6px #ef444488; }
.auw-running { background: #f59e0b; animation: auw-pulse 0.8s ease-in-out infinite; }
@keyframes auw-pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }
#auw-label { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.auw-btn {
    background: none;
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    color: var(--text-secondary);
    width: 22px; height: 22px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: color 0.2s, border-color 0.2s, transform 0.3s;
    flex-shrink: 0;
}
.auw-btn:hover  { color: var(--accent); border-color: var(--accent); }
.auw-btn.spinning { animation: auw-spin 0.8s linear infinite; }
@keyframes auw-spin { to { transform: rotate(360deg); } }

#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(400px, 62vh, 820px);
    min-width: 0;
}

/* Canvas */
#canvas-container {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 16px;
    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.78rem;
    color: #c8d6e8;
}
.standings-table thead tr { background: rgba(255,255,255,0.04); }
.standings-table th {
    padding: 7px 8px;
    font-size: 0.68rem;
    font-weight: 600;
    color: #4a6080;
    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 {
    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-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-upcoming { border-color: rgba(78,164,248,0.25); }
.kmc-done     { opacity: 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.72rem;
    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.02);
}
.kmc-score {
    font-size: 1rem;
    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.62rem;
    color: var(--text-muted);
}
.kmc-tag {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    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%; }
}
.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);
}
.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-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;
}

/* 시즌 시뮬레이션 (일정 배너 내) */
.season-sim-toggle {
    margin-top: 10px;
    width: 100%;
    background: linear-gradient(90deg, rgba(78,164,248,0.15), rgba(184,126,248,0.15));
    border: 1px solid rgba(78,164,248,0.3);
    border-radius: 8px;
    padding: 8px 12px;
    color: #c8d8f0;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.season-sim-toggle:hover {
    background: linear-gradient(90deg, rgba(78,164,248,0.25), rgba(184,126,248,0.25));
}
.season-sim-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
.season-sim-container.open {
    max-height: 800px;
    margin-top: 8px;
    overflow-y: auto;
}
.season-sim-body {
    background: rgba(18,29,54,0.7);
    border-radius: 8px;
    padding: 12px;
}
.ssb-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.65rem;
    color: #8ab0d8;
}
.ssb-zone { color: #facc15; }
.ssb-table { display: flex; flex-direction: column; gap: 2px; }
.ssb-row {
    display: grid;
    grid-template-columns: 28px 1fr 100px 80px 50px 50px 50px;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    font-size: 0.7rem;
    border-radius: 4px;
}
.ssb-row:hover { background: rgba(255,255,255,0.03); }
.ssb-row.ssb-head {
    color: #6a8aa8;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sst-rank {
    color: #6a8aa8;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.sst-team { color: #e8f2ff; font-weight: 600; }
.sst-pts { color: #8ab0d8; font-size: 0.62rem; }
.sst-bar {
    background: rgba(255,255,255,0.05);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}
.sst-bar-fill {
    display: block;
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}
.sst-pct {
    text-align: right;
    color: #c8d8f0;
    font-variant-numeric: tabular-nums;
}
.sim-empty {
    padding: 16px;
    text-align: center;
    color: #6a8aa8;
    font-size: 0.75rem;
}

/* 모바일: 시즌 시뮬 row 컬럼 축소 */
@media (max-width: 768px) {
    .ssb-row {
        grid-template-columns: 22px 1fr 60px 36px 36px 36px;
        font-size: 0.62rem;
    }
    .sst-bar { display: none; }
}

/* 예상 라인업 카드 */
.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-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;
}

/* 휴식일 + 심판 정보 카드 */
.pred-rest-ref {
    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;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.rrc-rest {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.rrc-rest-block {
    text-align: center;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 6px;
    padding: 8px 6px;
}
.rrc-rest-label {
    font-size: 0.6rem;
    color: #6a8aa8;
    margin-bottom: 4px;
}
.rrc-rest-val {
    font-size: 1.2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.rrc-rest-tag {
    margin-top: 3px;
    font-size: 0.62rem;
    color: #c8d8f0;
}
.rrc-ref {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 6px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.rrc-ref-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.rrc-ref-icon { font-size: 0.85rem; }
.rrc-ref-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: #e8f2ff;
    flex: 1;
}
.rrc-ref-strict {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
}
.rrc-strict-strict   { background: rgba(248,113,113,0.15); color: #f87171; border: 1px solid rgba(248,113,113,0.3); }
.rrc-strict-normal   { background: rgba(78,164,248,0.15); color: #4ea4f8; border: 1px solid rgba(78,164,248,0.3); }
.rrc-strict-lenient  { background: rgba(123,237,159,0.15); color: #7bed9f; border: 1px solid rgba(123,237,159,0.3); }
.rrc-ref-stats {
    font-size: 0.62rem;
    color: #8ab0d8;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
    .pred-rest-ref { 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; }
}

/* 골 타이밍 바 */
.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.7rem;
    color: #8ab0d8;
    text-align: center;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
}
.ptm-row {
    display: grid;
    grid-template-columns: 70px 1fr 28px;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 0.68rem;
}
.ptm-lbl { color: #6a8aa8; font-size: 0.62rem; }
.ptm-bar {
    display: inline-block;
    height: 8px;
    border-radius: 4px;
    min-width: 2px;
}
.ptm-v {
    color: #e8f2ff;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* 예상 스코어 λ 라벨 강조 */
.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-wrap: wrap; gap: 5px; }
.ld-year-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-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;
}
#insights-grid {
    display: block;
}
.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: 16px;
}
.ins-block-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #c8d8f0;
    margin-bottom: 12px;
}
.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; }
.ins-pos-tab.active { background: rgba(100,180,255,0.2); color: #7ecfff; }
.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); }
.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-body { padding: 20px 24px 40px; }
.drawer-section-title { font-size: 0.88rem; font-weight: 700; color: #7ecfff; margin-bottom: 10px; }

/* ── 팀 비교 모달 (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-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;
}




/* ── 다음 라운드 미리보기 (Pre-match prediction) ───────────────────── */
.prn-wrap {
    background: linear-gradient(180deg, rgba(15,23,42,0.92), rgba(15,23,42,0.85));
    border: 1px solid rgba(99,179,237,0.18);
    border-radius: 14px;
    padding: 18px 18px 14px;
    margin: 12px 0 16px;
    color: #e8eef7;
}
.prn-header { margin-bottom: 14px; }
.prn-title-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 8px; flex-wrap: wrap;
}
.prn-title {
    font-size: 1.05rem; font-weight: 700;
    background: linear-gradient(90deg, #63b3ed, #a78bfa);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.prn-tabs { display: inline-flex; gap: 4px; background: rgba(255,255,255,0.05); padding: 3px; border-radius: 8px; }
.prn-tab {
    padding: 5px 14px; font-size: 0.78rem; font-weight: 600;
    background: transparent; border: 0; border-radius: 6px;
    color: #94a3b8; cursor: pointer; transition: all 0.15s ease;
}
.prn-tab:hover { color: #e8eef7; }
.prn-tab.active { background: rgba(99,179,237,0.22); color: #e8eef7; }
.prn-acc { font-size: 0.82rem; color: #cbd5e1; margin-bottom: 4px; }
.prn-acc b { color: #fcd34d; }
.prn-disclaimer { font-size: 0.72rem; color: #94a3b8; opacity: 0.85; }

.prn-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 10px;
}
.prn-card {
    background: rgba(30,41,59,0.6);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex; flex-direction: column; gap: 8px;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.prn-card:hover { border-color: rgba(99,179,237,0.35); transform: translateY(-1px); }
.prn-card-skip { opacity: 0.55; }
.prn-meta { font-size: 0.7rem; color: #94a3b8; }
.prn-teams {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
    gap: 8px; font-size: 0.92rem; font-weight: 600;
}
.prn-h { text-align: left; }
.prn-a { text-align: right; }
.prn-vs { color: #64748b; font-size: 0.72rem; font-weight: 500; }
.prn-team.prn-pick { color: #fcd34d; }
.prn-bars { display: flex; flex-direction: column; gap: 3px; }
.prn-bar {
    height: 18px; border-radius: 4px; position: relative;
    background: rgba(99,179,237,0.18); overflow: hidden;
}
.prn-bar::before {
    content: ''; position: absolute; inset: 0;
    width: var(--w, 0%);
    background: rgba(99,179,237,0.42);
    transition: width 0.3s ease;
}
.prn-bar.prn-bar-d::before { background: rgba(148,163,184,0.42); }
.prn-bar.prn-bar-a::before { background: rgba(244,114,182,0.42); }
.prn-bar.prn-pick::before { background: rgba(252,211,77,0.55); }
.prn-bar span {
    position: relative; z-index: 1;
    display: block; padding: 0 8px; line-height: 18px;
    font-size: 0.7rem; font-weight: 600; color: #e8eef7;
}
.prn-score {
    font-size: 0.78rem; color: #cbd5e1;
    border-top: 1px solid rgba(255,255,255,0.05); padding-top: 6px;
}
.prn-score b { color: #fcd34d; font-weight: 700; }
.prn-note { font-size: 0.78rem; color: #94a3b8; }
.prn-loading, .prn-empty {
    text-align: center; padding: 20px; color: #94a3b8; font-size: 0.85rem;
    background: rgba(15,23,42,0.6); border-radius: 10px; margin: 12px 0;
}

@media (max-width: 768px) {
    .prn-grid { grid-template-columns: 1fr; }
    .prn-title-row { flex-direction: column; align-items: flex-start; }
}

/* top scores 3개 노출 */
.prn-score {
    font-size: 0.78rem; color: #cbd5e1;
    border-top: 1px solid rgba(255,255,255,0.05); padding-top: 6px;
    line-height: 1.55;
}
.prn-ts {
    color: #94a3b8;
    margin-right: 2px;
}
.prn-ts em {
    font-style: normal;
    color: #cbd5e1;
    font-size: 0.72rem;
}
.prn-ts-pick {
    color: #fcd34d;
    font-weight: 700;
}
.prn-ts-pick em {
    color: #fcd34d;
}
.prn-lambda {
    font-size: 0.7rem; color: #64748b;
    margin-top: 2px;
}

/* ── prn polish: 팀컬러 stripe / 엠블럼 / 모바일 ───────────────── */
.prn-card {
    position: relative;
    overflow: hidden;
}
.prn-stripe {
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--home-col, #334) 0% 50%, var(--away-col, #334) 50% 100%);
    opacity: 0.85;
}
.prn-meta {
    display: flex; gap: 6px; align-items: baseline;
    font-size: 0.7rem; color: #94a3b8;
    margin-top: 4px;
}
.prn-meta .prn-venue {
    color: #64748b;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex: 1; min-width: 0;
}
.prn-team {
    display: flex; align-items: center; gap: 6px; min-width: 0;
}
.prn-h { justify-content: flex-start; }
.prn-a { justify-content: flex-end; }
.prn-emb {
    width: 22px; height: 22px; object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}
.prn-tname {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    min-width: 0;
}
.prn-team.prn-pick .prn-tname {
    text-shadow: 0 0 12px rgba(252,211,77,0.4);
}
.prn-vs {
    font-size: 0.65rem; font-weight: 600; color: #64748b;
    letter-spacing: 0.08em; flex-shrink: 0;
}

/* 모바일 (768px 이하) — 카드 1열, 콤팩트 */
@media (max-width: 768px) {
    .prn-wrap { padding: 14px 12px 10px; }
    .prn-grid { grid-template-columns: 1fr; gap: 8px; }
    .prn-card { padding: 10px 12px; }
    .prn-title { font-size: 0.95rem; }
    .prn-teams { font-size: 0.85rem; }
    .prn-emb { width: 18px; height: 18px; }
    .prn-bars { gap: 2px; }
    .prn-bar { height: 16px; }
    .prn-bar span { line-height: 16px; font-size: 0.65rem; padding: 0 6px; }
    .prn-score { font-size: 0.72rem; }
    .prn-disclaimer { font-size: 0.65rem; }
}

/* 매우 좁은 화면 (480px 이하) */
@media (max-width: 480px) {
    .prn-meta .prn-venue { display: none; }
    .prn-vs { font-size: 0.6rem; }
}

/* 직전 포메이션 칩 */
.prn-formations {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; padding: 4px 0;
    font-size: 0.72rem;
    border-top: 1px dashed rgba(255,255,255,0.06);
    border-bottom: 1px dashed rgba(255,255,255,0.06);
}
.prn-form-h, .prn-form-a {
    background: rgba(99,179,237,0.13);
    color: #cbd5e1;
    padding: 2px 8px; border-radius: 4px;
    font-weight: 600; font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}
.prn-form-h { color: var(--home-col, #cbd5e1); background: color-mix(in srgb, var(--home-col, #94a3b8) 15%, transparent); }
.prn-form-a { color: var(--away-col, #cbd5e1); background: color-mix(in srgb, var(--away-col, #94a3b8) 15%, transparent); }
.prn-form-vs {
    font-size: 0.62rem; color: #64748b;
    text-transform: uppercase; letter-spacing: 0.1em;
    flex: 1; text-align: center;
}

/* ── 골 타이밍 패널 ──────────────────────────────────────── */
.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; }
