﻿/* ============================================================================
   mock-league.css — 모의투자 리그 현황 팝업 (.ml-*)
   테마 토큰(theme.css)만 쓴다. 팝업 틀은 calendar-panel.css 의 .rightside-popup-cp 를 재사용.
   ============================================================================ */
.rightside-popup-league { width: min(94vw, 1080px); }
.ml-host { padding: 0 14px 18px; }
.ml { color: var(--text-primary); font-size: calc(13px * var(--fs-scale, 1)); line-height: 1.45; }
.ml .is-up { color: var(--red-up); }
.ml .is-down { color: var(--blue-down); }
.ml-muted { color: var(--text-muted); font-size: calc(13px * var(--fs-scale, 1)); }
.ml-note { margin: 8px 2px 0; color: var(--text-muted); font-size: calc(13px * var(--fs-scale, 1)); }
.ml-empty { margin: 0; padding: 22px 0; text-align: center; color: var(--text-muted); }

/* 시즌 선택 */
.ml-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 2px 8px; flex-wrap: wrap; }
.ml-season select { appearance: none; -webkit-appearance: none; padding: 8px 32px 8px 12px; border-radius: 10px; border: 1px solid var(--border-color); background: var(--bg-light) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center / 16px; color: var(--text-primary); font-size: calc(15px * var(--fs-scale, 1)); font-weight: 700; cursor: pointer; }
.ml-basis { color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* 배너 */
.ml-banner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 26px; border-radius: 16px; overflow: hidden;
    background: linear-gradient(100deg, #ff8a3d 0%, #ff5a6e 55%, #ff3d8d 100%); color: #fff; box-shadow: 0 10px 30px rgba(255, 90, 110, .25); }
.ml-banner-slogan { margin: 0 0 4px; font-weight: 600; opacity: .95; }
.ml-banner-title { margin: 0; font-size: calc(24px * var(--fs-scale, 1)); font-weight: 900; letter-spacing: -.02em; }
.ml-banner-r { display: flex; flex-direction: column; gap: 8px; margin-right: 70px; font-variant-numeric: tabular-nums; }
.ml-banner-row { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.ml-tag { padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: #e8443f; font-weight: 700; font-size: calc(13px * var(--fs-scale, 1)); }
.ml-banner-trophy { position: absolute; right: 18px; top: 50%; transform: translateY(-50%) rotate(-8deg); font-size: 64px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .25)); }

/* 2단 */
.ml-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 28px; margin-top: 14px; }
.ml-col { min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.ml-sec { min-width: 0; }
.ml-h { margin: 0 0 10px; font-size: calc(16px * var(--fs-scale, 1)); font-weight: 800; letter-spacing: -.01em; }
.ml-h-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
    .ml-h-row .ml-h { margin: 0; }

/* 리그개요 */
.ml-dl { margin: 0; padding: 6px 16px; border-radius: 12px; background: var(--bg-light); border: 1px solid var(--border-subtle); }
    .ml-dl > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-subtle); }
    .ml-dl > div:last-child { border-bottom: 0; }
    .ml-dl dt { color: var(--text-muted); white-space: nowrap; }
    .ml-dl dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
    .ml-dl-desc dd { text-align: left; font-weight: 500; color: var(--text-secondary); }
    .ml-dl-desc dd .ml-warn { color: var(--red-up); font-weight: 600; }   /* 순위 제외 기준 강조 (2026-10-16) */
.ml-link { border: 0; background: transparent; color: var(--red-up); font-weight: 700; cursor: pointer; padding: 0; font-family: inherit; }
    .ml-link:hover { text-decoration: underline; }

/* 순위 번호 · 로고 */
.ml-no { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: calc(13px * var(--fs-scale, 1)); background: var(--fg-a08); color: var(--text-secondary); }
    .ml-no.is-1 { background: rgba(245, 196, 81, .22); color: #b8860b; }
    .ml-no.is-2 { background: var(--fg-a10); color: var(--text-primary); }
    .ml-no.is-3 { background: rgba(var(--red-up-rgb), .15); color: var(--red-up); }
.ml-logo { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--c-blue), var(--c-purple)); color: #fff; font-weight: 800; font-size: calc(13px * var(--fs-scale, 1)); }

/* 매매종목 상위 */
.ml-rank-list { list-style: none; margin: 0; padding: 0; }
    .ml-rank-list li { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--border-subtle); }
.ml-stock { flex: 1 1 auto; min-width: 0; text-align: left; border: 0; background: transparent; color: var(--text-primary); font: inherit; font-weight: 600; cursor: pointer; padding: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .ml-stock:hover { text-decoration: underline; }
.ml-amt { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 수익/손실 종목 막대 */
.ml-seg { display: inline-flex; border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; }
.ml-seg-btn { border: 0; background: transparent; color: var(--text-muted); padding: 5px 14px; font: inherit; font-weight: 600; cursor: pointer; }
    .ml-seg-btn.is-on { background: var(--bg-lighter); color: var(--text-primary); }
.ml-bars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; align-items: end; padding: 6px 2px 0; }
.ml-bar { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: transparent; padding: 0; cursor: pointer; font: inherit; color: var(--text-primary); min-width: 0; }
.ml-bar-col { width: 100%; height: 150px; display: flex; align-items: flex-end; }
    .ml-bar-col i { display: block; width: 100%; border-radius: 10px 10px 4px 4px; background: var(--red-up); transition: height .3s ease; }
.ml-bars.is-loss .ml-bar-col i { background: var(--blue-down); }
.ml-bar-rate { font-variant-numeric: tabular-nums; font-size: calc(14px * var(--fs-scale, 1)); }
.ml-bar-name { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-secondary); }

/* 업종 */
.ml-sector-list { list-style: none; margin: 0; padding: 0; }
    .ml-sector-list li { display: grid; grid-template-columns: 22px 1fr 110px 48px; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--border-subtle); }
.ml-sector-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-sector-bar { height: 8px; border-radius: 999px; background: var(--fg-a08); overflow: hidden; }
    .ml-sector-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--c-blue), var(--c-purple)); }
.ml-sector-pct { text-align: right; font-variant-numeric: tabular-nums; }

/* 보상 */
.ml-prizes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ml-prize { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; min-width: 0; }
.ml-prize-img { width: 120px; height: 120px; border-radius: 50%; background: var(--bg-light); border: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 6px; }
    .ml-prize-img img { width: 100%; height: 100%; object-fit: cover; }
.ml-prize-ph { font-size: 44px; }
.ml-prize-cond { color: var(--text-muted); }
.ml-prize-title { font-size: calc(14px * var(--fs-scale, 1)); }
.ml-prize-desc { color: var(--text-muted); }

/* 참가현황 */
.ml-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px 10px; border-radius: 12px; background: var(--bg-light); border: 1px solid var(--border-subtle); text-align: center; }
    .ml-stats div { display: flex; flex-direction: column; gap: 4px; }
    .ml-stats span { color: var(--text-muted); }
    .ml-stats b { font-size: calc(17px * var(--fs-scale, 1)); font-variant-numeric: tabular-nums; }
.ml-share { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ml-share-row { position: relative; display: flex; align-items: center; justify-content: space-between; height: 40px; padding: 0 12px; border-radius: 10px; overflow: hidden; background: var(--bg-light); }
    .ml-share-row i { position: absolute; left: 0; top: 0; bottom: 0; z-index: 0; }
    .ml-share-row.is-up i { background: rgba(var(--red-up-rgb), .12); }
    .ml-share-row.is-down i { background: rgba(var(--blue-down-rgb), .12); }
    .ml-share-row .ml-share-lbl, .ml-share-row b { position: relative; z-index: 1; }
    .ml-share-row.is-up b { color: var(--red-up); }
    .ml-share-row.is-down b { color: var(--blue-down); }

/* 랭킹 */
.ml-me { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--bg-light); border: 1px solid var(--border-subtle); margin-bottom: 14px; }
    .ml-me span { color: var(--text-muted); }
    .ml-me b:nth-of-type(1) { flex: 1 1 auto; }
    .ml-me.is-on { cursor: pointer; border-color: var(--border-strong); }
.ml-podium { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; align-items: end; padding: 6px 0 14px; }
.ml-pod { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: transparent; padding: 0; font: inherit; color: var(--text-primary); cursor: pointer; min-width: 0; }
    .ml-pod.is-vacant { cursor: default; opacity: .5; }
.ml-pod-name { display: flex; align-items: center; gap: 4px; max-width: 100%; }
.ml-pod-rate { font-variant-numeric: tabular-nums; }
.ml-pod-block { width: 100%; height: 50px; margin-top: 6px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--text-secondary); background: var(--fg-a05); }
.ml-pod.is-1 .ml-pod-block { height: 70px; background: rgba(245, 196, 81, .18); color: #b8860b; }
.ml-pod.is-3 .ml-pod-block { height: 40px; background: rgba(var(--red-up-rgb), .10); color: var(--red-up); }
.ml-avatar { width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto; display: inline-block; position: relative; }
    .ml-avatar::after { content: ''; position: absolute; left: 50%; top: 50%; width: 46%; height: 46%; transform: translate(-50%, -62%); border-radius: 50%; background: rgba(255, 255, 255, .85); }
    .ml-avatar::before { content: ''; position: absolute; left: 50%; bottom: 0; width: 80%; height: 40%; transform: translateX(-50%); border-radius: 50% 50% 0 0; background: rgba(255, 255, 255, .85); }
    .ml-avatar.is-lg { width: 52px; height: 52px; }
    .ml-avatar { overflow: hidden; }
    .ml-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; background: #fff; }
    .ml-avatar.has-img::before, .ml-avatar.has-img::after { display: none; }
.ml-nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ml-chip { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 999px; font-style: normal; font-size: calc(13px * var(--fs-scale, 1)); font-weight: 700; line-height: 18px; }
    .ml-chip.is-me { background: var(--red-up); color: var(--on-accent); }
    .ml-chip.is-win { background: rgba(245, 196, 81, .22); color: #b8860b; }
.ml-list { list-style: none; margin: 0; padding: 0; }
.ml-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 6px; border: 0; border-bottom: 1px solid var(--border-subtle); background: transparent; color: var(--text-primary); font: inherit; text-align: left; cursor: pointer; }
    .ml-row[data-ml-player]:hover { background: var(--fg-a05); }
    .ml-row.is-me { background: rgba(var(--red-up-rgb), .06); }
.ml-row-no { width: 26px; text-align: center; font-variant-numeric: tabular-nums; color: var(--text-secondary); flex: 0 0 auto; }
.ml-row .ml-nm { flex: 1 1 auto; }
.ml-row-rate { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ml-pager { display: flex; justify-content: center; gap: 4px; margin-top: 12px; }
.ml-pg { min-width: 30px; height: 30px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border-subtle); background: var(--bg-light); color: var(--text-primary); cursor: pointer; font: inherit; }
    .ml-pg.is-active { background: var(--text-primary); color: var(--bg-dark); border-color: var(--text-primary); font-weight: 700; }
    .ml-pg:disabled { opacity: .4; cursor: default; }

@media (max-width: 760px) {
    .ml-grid { grid-template-columns: 1fr; }
    .ml-banner { flex-direction: column; align-items: flex-start; }
    .ml-banner-r { margin-right: 0; }
    .ml-banner-trophy { display: none; }
    .ml-prizes { grid-template-columns: repeat(3, 1fr); }
}

/* 여백 — 팝업 안이 답답하지 않게 */
.rightside-popup-league .rightside-popup-header { padding: 16px 26px; }
.ml-host { padding: 0 26px 30px; }
.ml-top { padding: 14px 2px 12px; }
.ml-banner { margin: 2px 0 6px; padding: 26px 30px; }
.ml-grid { gap: 12px 36px; margin-top: 22px; }
.ml-col { gap: 30px; }
.ml-h { margin-bottom: 12px; }
.ml-h-row { margin-bottom: 12px; }
.ml-dl { padding: 8px 18px; }
.ml-rank-list li, .ml-sector-list li { padding: 11px 6px; }
.ml-prizes { gap: 14px; padding: 4px 0; }
.ml-stats { padding: 18px 12px; }
/* 종목 로고: tomato.co.kr/images/CompanyLogo/{6자리코드}.png (관심목록 모의계좌·증시동향과 같은 규칙), 없으면 첫 글자 배지 */
.ml-logo { position: relative; overflow: hidden; }
    .ml-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); clip-path: circle(46.3% at 50% 50%); }   /* 흰 테 방지 (2026-10-12) — 흰 배경을 깔면 원 가장자리에 비친다. 회사 로고 PNG 는 가장자리까지 불투명이라 배경이 필요 없다 */
.ml-logo:has(img) { background: none; }   /* 로고가 있으면 뒤의 글자 배지 색이 가장자리로 비치지 않게 */

/* 여백 2차 — calendar-panel.css 의 .rightside-popup-cp .rightside-popup-content(두 클래스) 가 .ml-host 한 클래스보다 우선해 앞의 여백이 안 먹었다 */
.rightside-popup-league { width: min(94vw, 1140px); }
.rightside-popup-league .rightside-popup-content.ml-host { padding: 0 44px 48px; }
.rightside-popup-league .rightside-popup-header { padding: 18px 30px; }
.ml-top { padding: 22px 2px 18px; }
.ml-banner { margin: 4px 0 12px; padding: 30px 34px; }
.ml-grid { gap: 20px 56px; margin-top: 34px; }
.ml-col { gap: 40px; }
.ml-h, .ml-h-row { margin-bottom: 16px; }
.ml-dl { padding: 10px 20px; }
.ml-rank-list li, .ml-sector-list li { padding: 13px 8px; }
.ml-prizes { gap: 20px; padding: 8px 0; }
.ml-stats { padding: 22px 14px; }
.ml-share { margin-top: 14px; gap: 10px; }
.ml-me { padding: 14px 16px; margin-bottom: 18px; }
.ml-podium { padding: 10px 0 20px; }
.ml-bars { padding: 12px 6px 4px; gap: 12px; }
@media (max-width: 760px) {
    .rightside-popup-league .rightside-popup-content.ml-host { padding: 0 18px 28px; }
    .ml-grid { gap: 20px; }
}

/* ───────── 보상 신청 팝업 (iframe) ───────── */
.rightside-popup-claim { width: min(94vw, 640px); }
/* 팝업 높이는 안쪽 내용만큼 (mock-league.js 가 iframe 높이를 맞춘다) — 고정 88vh 면 내용이 짧을 때 아래가 비었다 */
.rightside-popup-cp.rightside-popup-claim { height: auto; max-height: 88vh; }
.rightside-popup-claim .rightside-popup-content.ml-claim-host { padding: 0; overflow: hidden; display: flex; }
.ml-claim-host iframe { display: block; width: 100%; height: min(60vh, 560px); max-height: 100%; border: 0; background: transparent; }

/* ───────── 당첨 배너 ───────── */
.ml-win-banner {
    position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 9000;
    display: flex; align-items: center; gap: 12px; max-width: min(92vw, 560px); padding: 12px 14px 12px 16px;
    border-radius: 14px; background: var(--bg-light); border: 1px solid var(--border-strong);
    box-shadow: 0 12px 34px rgba(0, 0, 0, .35); color: var(--text-primary);
    font-size: calc(13px * var(--fs-scale, 1)); line-height: 1.4;
    animation: mlWinIn .35s cubic-bezier(.2, .8, .2, 1);
}
@keyframes mlWinIn { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
.ml-win-ico { font-size: 26px; line-height: 1; flex: 0 0 auto; }
.ml-win-body { min-width: 0; flex: 1; }
.ml-win-title { font-weight: 700; }
.ml-win-title b { color: var(--red-up); }
.ml-win-sub { color: var(--text-secondary); font-size: calc(12px * var(--fs-scale, 1)); margin-top: 2px; }
.ml-win-sub b { color: var(--text-primary); font-weight: 600; }
.ml-win-btn {
    flex: 0 0 auto; height: 36px; padding: 0 14px; border-radius: 10px; border: 0; cursor: pointer;
    background: var(--red-up); color: #fff; font: inherit; font-weight: 700;
}
.ml-win-btn:hover { filter: brightness(1.08); }
.ml-win-close { flex: 0 0 auto; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--text-secondary); font-size: 20px; line-height: 1; cursor: pointer; }
.ml-win-close:hover { background: var(--fg-a10); color: var(--text-primary); }

/* 시즌 순위 마감 안내 (2026-10-07) */
.ml-lock { margin: 0 0 8px; padding: 7px 10px; border-radius: 8px; background: rgba(245, 158, 11, .12); }
