/*
 * VS 비교 화면. 블루팀(왼쪽) / 레드팀(오른쪽)은 게임 안의 진영 색을 그대로 쓴다.
 * 가운데 비교표가 이 페이지의 주인공이라 나머지는 선과 여백 위주로 조용하게 둔다.
 */
:root {
    --ink: #0c111c;
    --panel: #131b2b;
    --panel-2: #1a2438;
    --line: rgba(255, 255, 255, .08);
    --text: #e9edf5;
    --mute: #8c97ad;
    --blue: #5b8cff;
    --red: #ff5c68;
    --gold: #c8aa6e;
}

.vs-container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px 60px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 440px) minmax(0, 1fr);
    column-gap: 28px;
    row-gap: 36px;
    position: relative;
    z-index: 9;
    align-items: start;
}

/* ───── 양쪽 선수 ───── */
.side { min-width: 0; }
.side-a { --side: var(--blue); }
.side-b { --side: var(--red); }

.side .finder {
    display: flex;
    margin: 0 0 14px;
    border-bottom: 2px solid var(--side);
}
.side .finder .form-control {
    background: transparent;
    border: 0;
    border-radius: 0;
    color: var(--text);
    font-size: 17px;
    padding: 10px 2px;
    box-shadow: none;
}
.side .finder .form-control::placeholder { color: var(--mute); }
.side .finder .search-button {
    background: var(--side);
    color: #0c111c;
    font-weight: 700;
    border: 0;
    border-radius: 0;
    padding: 0 20px;
}
.side .finder .search-button:hover { filter: brightness(1.12); }

.side .vsb-info { position: relative; min-height: 200px; }
.side .no-data {
    margin: 0;
    padding: 56px 0;
    text-align: center;
    color: var(--mute);
    font-size: 15px;
    line-height: 1.6;
}
.loading-img {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}

.vs-player {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 14px;
}
.vsp-icon { position: relative; flex: none; }
.vsp-icon img {
    width: 64px; height: 64px;
    border-radius: 50%;
    border: 3px solid var(--side);
    display: block;
}
.vsp-level {
    position: absolute;
    left: 50%; bottom: -8px;
    transform: translateX(-50%);
    background: var(--ink);
    border: 1px solid var(--side);
    color: var(--text);
    font-size: 11px;
    padding: 0 7px;
    border-radius: 9px;
}
.vsp-id {
    flex: 1;
    min-width: 0;
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vsp-tag { font-size: 14px; font-weight: 500; color: var(--mute); margin-left: 4px; }
.vsp-btn {
    flex: none;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--mute);
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 4px;
}
.vsp-btn:hover { color: var(--text); border-color: var(--side); }

.ranks { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.rank-cell { padding: 14px 0 12px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.rank-cell + .rank-cell { padding-left: 16px; border-left: 1px solid var(--line); }
.rank-cell img { width: 48px; height: 48px; flex: none; }
.rank-cell .rk-kind { font-size: 12px; color: var(--mute); }
.rank-cell .rk-name { font-size: 15px; font-weight: 700; color: var(--text); }
.rank-cell .rk-wl { font-size: 12px; color: var(--mute); }
.rank-cell.unranked .rk-name { color: var(--mute); font-weight: 500; }

.vs-most-list {
    list-style: none;
    margin: 0; padding: 12px 0;
    display: flex; gap: 8px;
    border-top: 1px solid var(--line);
}
.vs-most { position: relative; }
.vs-most img { width: 44px; height: 44px; border-radius: 6px; display: block; }
.vsm-level {
    position: absolute; right: -3px; bottom: -3px;
    background: var(--ink); color: var(--gold);
    font-size: 10px; line-height: 1;
    padding: 2px 4px; border-radius: 3px;
}

.vs-game-recent { border-top: 1px solid var(--line); padding-top: 12px; }
.recent-head { font-size: 12px; color: var(--mute); margin-bottom: 8px; }
.recent-wl { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.recent-wl strong { font-size: 15px; color: var(--text); }
.recent-wl span { font-size: 13px; color: var(--mute); }
.recent-wl .red { color: var(--red); }
.vstg-bar { height: 6px; margin-top: 8px; background: var(--red); border-radius: 3px; overflow: hidden; }
.vstg-gage { display: block; height: 100%; background: var(--blue); }

/* ───── 가운데 비교표 ───── */
.duel { padding: 4px 0 0; }
.duel-mark {
    text-align: center;
    font-family: 'Black Han Sans', 'Pretendard Variable', sans-serif;
    font-size: 76px;
    line-height: 1;
    letter-spacing: 2px;
    color: var(--gold);
    margin: 0 0 6px;
}
.duel-score {
    display: flex; justify-content: center; align-items: baseline; gap: 14px;
    font-family: 'Black Han Sans', 'Pretendard Variable', sans-serif;
    font-size: 30px; color: var(--mute);
    min-height: 38px;
    margin-bottom: 18px;
}
.duel-score .a { color: var(--blue); }
.duel-score .b { color: var(--red); }
.duel-score .lead { color: var(--text); }
.duel-score .a.lead { color: var(--blue); }
.duel-score .b.lead { color: var(--red); }

.drow {
    display: grid;
    grid-template-columns: 1fr 76px 1fr;
    align-items: center;
    gap: 10px;
    padding: 11px 0;
    border-top: 1px solid var(--line);
}
.dlabel { text-align: center; font-size: 13px; color: var(--mute); }
.dside { display: flex; flex-direction: column; gap: 5px; }
.dside b {
    font-size: 20px; font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--mute);
    line-height: 1;
}
.dside i {
    display: block; height: 5px; width: var(--w, 0%);
    background: var(--mute); opacity: .35;
    transition: width .5s cubic-bezier(.2, .8, .2, 1);
}
.dside.l { align-items: flex-end; text-align: right; }
.dside.l i { margin-left: auto; }
.dside.l.win b { color: var(--blue); } .dside.l.win i { background: var(--blue); opacity: 1; }
.dside.r.win b { color: var(--red); }  .dside.r.win i { background: var(--red); opacity: 1; }
.duel-empty { text-align: center; color: var(--mute); font-size: 14px; line-height: 1.6; padding: 24px 0; border-top: 1px solid var(--line); }
.duel-note { margin: 14px 0 0; font-size: 12px; color: var(--mute); text-align: center; }

/* ───── 아래 최근 게임 목록 ───── */
.vs-lists {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}
.vs-lists .vs-box { min-width: 0; }
.vs-lists .vs-box:first-child { --side: var(--blue); }
.vs-lists .vs-box:last-child { --side: var(--red); }
.vs-lists .vst-game-list { position: relative; min-height: 0; }

@media (max-width: 1100px) {
    .vs-container { grid-template-columns: 1fr 1fr; }
    .duel { grid-column: 1 / -1; grid-row: 2; }
    .vs-lists { grid-row: 3; }
}
@media (max-width: 760px) {
    .vs-container { grid-template-columns: 1fr; padding: 0 14px 40px; }
    .duel { grid-row: auto; order: 3; }
    .vs-lists { grid-template-columns: 1fr; order: 4; overflow-x: auto; }
    .duel-mark { font-size: 56px; }
}

@media (prefers-reduced-motion: reduce) {
    .dside i { transition: none; }
}

/* 처음엔 5경기만, 나머지는 더보기 */
.vst-game-list.collapsed .vst-game-box.extra { display: none; }
.more-games {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 11px 0;
    background: transparent;
    color: var(--mute);
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 14px;
}
.more-games:hover { color: var(--text); border-color: var(--side, var(--mute)); }

/* 최근 많이 한 챔피언 */
.champ-rows { list-style: none; margin: 0; padding: 0; }
.champ-rows li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.champ-rows img { width: 34px; height: 34px; border-radius: 6px; flex: none; }
.champ-rows .cn { flex: 1; min-width: 0; color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.champ-rows .cs, .champ-rows .ck { color: var(--mute); font-variant-numeric: tabular-nums; }
.champ-rows .ck { min-width: 70px; text-align: right; color: var(--side, var(--text)); }

/* ───── 특색: 대전 화면 ───── */
.vs-body {
    background:
        radial-gradient(55% 380px at 0% 0%, rgba(91, 140, 255, .16), transparent 70%),
        radial-gradient(55% 380px at 100% 0%, rgba(255, 92, 104, .16), transparent 70%);
}
/* VS 글자 뒤로 비스듬히 가르는 선: 두 진영이 맞붙는 느낌 */
.duel { position: relative; }
.duel::before {
    content: '';
    position: absolute;
    left: 50%; top: -6px;
    width: 2px; height: 120px;
    background: linear-gradient(var(--blue), var(--red));
    transform: translateX(-50%) rotate(14deg);
    opacity: .55;
}
.duel-mark { position: relative; text-shadow: 0 0 28px rgba(200, 170, 110, .35); }
.duel-tug { height: 6px; background: var(--red); margin: 0 auto 10px; max-width: 280px; overflow: hidden; transform: skewX(-20deg); }
.duel-tug span { display: block; height: 100%; background: var(--blue); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.duel-verdict { text-align: center; min-height: 24px; margin-bottom: 14px; font-size: 15px; color: var(--mute); }
.duel-verdict b { font-weight: 800; font-size: 17px; }
.duel-verdict b.a { color: var(--blue); }
.duel-verdict b.b { color: var(--red); }
@media (prefers-reduced-motion: reduce) { .duel-tug span { transition: none; } }

/* ───── 플레이어 패널을 작게 ───── */
.side .finder .form-control { font-size: 15px; padding: 8px 2px; }
.side .finder .search-button { padding: 0 16px; font-size: 14px; }
.side .vsb-info { min-height: 120px; }
.side .no-data { padding: 34px 0; font-size: 14px; }
.vs-player { gap: 10px; padding-bottom: 12px; }
.vsp-icon img { width: 44px; height: 44px; border-width: 2px; }
.vsp-level { font-size: 10px; bottom: -6px; }
.vsp-id { font-size: 17px; }
.vsp-tag { font-size: 12px; }
.vsp-btn { font-size: 11px; padding: 4px 8px; }
.rank-cell { padding: 9px 0 8px; gap: 8px; }
.rank-cell + .rank-cell { padding-left: 12px; }
.rank-cell img { width: 34px; height: 34px; }
.rank-cell .rk-kind { font-size: 11px; }
.rank-cell .rk-name { font-size: 13px; }
.rank-cell .rk-wl { font-size: 11px; }
.recent-head { font-size: 11px; margin-bottom: 6px; }
.recent-wl strong { font-size: 13px; }
.recent-wl span { font-size: 12px; }
.vs-game-recent { padding-top: 9px; }

/* 이번 시즌 모스트가 주인공, 숙련도는 작은 아이콘 한 줄 */
.season-most { border-top: 1px solid var(--line); padding: 10px 0 4px; }
.season-wait { margin: 4px 0 6px; font-size: 12px; color: var(--mute); }
.champ-rows li { padding: 6px 0; }
.champ-rows img { width: 30px; height: 30px; }
.champ-rows li:first-child .cn { font-size: 15px; }
.vs-most-list { padding: 8px 0; gap: 5px; }
.vs-most img { width: 26px; height: 26px; border-radius: 4px; opacity: .75; }
.vsm-level { font-size: 9px; padding: 1px 3px; }

/* ───── 버튼: 대전 게임처럼 비스듬한 평행사변형, 진영 색 ───── */
.side-a .search-button { clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%); padding-right: 24px; }
.side-b .search-button { clip-path: polygon(12px 0, 100% 0, 100% 100%, 0 100%); padding-left: 24px; }
.side .finder .search-button {
    font-weight: 800;
    letter-spacing: .06em;
    transition: transform .12s ease, filter .12s ease;
}
.side-a .finder .search-button:hover { transform: translateX(2px); }
.side-b .finder .search-button:hover { transform: translateX(-2px); }
.side .finder .search-button:active { transform: scale(.97); }

.vsp-btn {
    background: color-mix(in srgb, var(--side) 16%, transparent);
    color: var(--side);
    border: 0;
    font-weight: 700;
    clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
    padding: 5px 14px;
    transition: background .12s ease, color .12s ease;
}
.vsp-btn:hover { background: var(--side); color: #0c111c; border: 0; }

.more-games {
    background: var(--panel-2);
    border: 0;
    clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
    font-weight: 700;
    letter-spacing: .04em;
    transition: background .12s ease, color .12s ease;
}
.more-games:hover { background: var(--side, var(--mute)); color: #0c111c; border: 0; }
.more-games:disabled { opacity: .6; cursor: default; }

.side .finder .search-button:focus-visible,
.vsp-btn:focus-visible,
.more-games:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* 전적 목록 닉네임: 눌러서 반대쪽에 띄우기 */
.vs-lists .lid-name { cursor: pointer; }
.vs-lists .lid-name:hover { color: var(--text); text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
    .side .finder .search-button, .vsp-btn, .more-games { transition: none; }
}

/* ───── 여백 정리: 너무 붙어 있던 곳을 숨 쉬게 ───── */
.vs-container { padding-top: 32px; column-gap: 36px; row-gap: 40px; }
.side .finder { margin-bottom: 20px; }
.side .finder .form-control { padding: 10px 4px; }
.vs-player { gap: 14px; padding-bottom: 18px; }
.vsp-icon img { width: 52px; height: 52px; }
.vsp-level { bottom: -8px; padding: 1px 7px; }
.vsp-id { font-size: 19px; line-height: 1.3; }
.vsp-tag { margin-left: 6px; }
.vsp-btn { padding: 6px 14px; }
.rank-cell { padding: 14px 0 12px; gap: 12px; }
.rank-cell + .rank-cell { padding-left: 16px; }
.rank-cell > div { line-height: 1.5; }
.rank-cell img { width: 38px; height: 38px; }
.season-most { padding: 14px 0 6px; }
.recent-head { margin-bottom: 8px; line-height: 1.4; }
.season-wait { margin: 6px 0 8px; line-height: 1.5; }
.champ-rows li { gap: 12px; padding: 9px 0; }
.champ-rows img { width: 32px; height: 32px; }
.champ-rows .ck { min-width: 84px; }
.vs-most-list { padding: 14px 0; gap: 8px; }
.vs-most img { width: 30px; height: 30px; }
.vs-game-recent { padding-top: 14px; }
.recent-wl { flex-wrap: wrap; row-gap: 4px; }
.vstg-bar { margin-top: 10px; }

.duel { padding-top: 8px; }
.duel-mark { margin-bottom: 10px; }
.duel-score { margin-bottom: 22px; }
.duel-verdict { line-height: 1.5; margin-bottom: 20px; padding: 0 8px; }
.drow { padding: 14px 0; gap: 12px; }
.dside { gap: 7px; }
.duel-empty { padding: 28px 12px; }
.duel-note { margin-top: 18px; }

.side .no-data, .vst-game-list > .no-data { line-height: 1.7; }
/* 더보기로 이어 붙인 목록 묶음 사이에도 경기 사이와 같은 간격 */
.vst-game-list > .vst-game-list + .vst-game-list { margin-top: 10px; }
.more-games { margin-top: 14px; padding: 13px 0; }

@media (max-width: 1100px) {
    .vs-container { column-gap: 24px; row-gap: 32px; }
}
@media (max-width: 760px) {
    .vs-container { padding: 20px 16px 48px; row-gap: 28px; }
    .vs-lists { gap: 32px; }
    .duel-mark { font-size: 52px; }
    .drow { grid-template-columns: 1fr 64px 1fr; }
}

/* 검색 서버 선택 (KR, NA, EUW …) */
.side .finder .region-select {
    flex: 0 0 auto;
    width: auto;
    max-width: 78px;
    background: transparent;
    color: var(--side);
    border: 0;
    border-right: 1px solid var(--line, rgba(255, 255, 255, .15));
    font-weight: 700;
    font-size: 14px;
    padding: 0 6px;
    cursor: pointer;
}
.side .finder .region-select option { color: #111; }
