/* 경우의 수 */
:root {
    --bg: #f4f6f3;
    --card: #ffffff;
    --ink: #14201b;
    --sub: #5c6b64;
    --line: #e2e7e3;
    --brand: #0f3d2e;
    --accent: #16a34a;
    --accent-soft: #dcf5e4;
    --gold: #c9a227;
    --warn: #8a5a00;
    --warn-bg: #fff6e0;
    --me: #eef9f1;
    --radius: 16px;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0d1411;
        --card: #151e1a;
        --ink: #e7eeea;
        --sub: #95a69d;
        --line: #26332d;
        --brand: #0b2a20;
        --accent: #34d16b;
        --accent-soft: #173a25;
        --gold: #e2bd45;
        --warn: #f0c56a;
        --warn-bg: #2b2412;
        --me: #18291f;
    }
}
:root[data-theme="dark"] {
    --bg: #0d1411; --card: #151e1a; --ink: #e7eeea; --sub: #95a69d; --line: #26332d;
    --brand: #0b2a20; --accent: #34d16b; --accent-soft: #173a25; --gold: #e2bd45;
    --warn: #f0c56a; --warn-bg: #2b2412; --me: #18291f;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.6 Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
    word-break: keep-all;
}
a { color: var(--accent); }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }

.top { background: var(--brand); color: #fff; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { color: #fff; font-weight: 800; font-size: 18px; text-decoration: none; letter-spacing: -0.02em; }
.dday { font-size: 13px; font-weight: 700; background: rgba(255, 255, 255, .14); padding: 4px 10px; border-radius: 999px; }

.hero {
    margin: 20px 0 16px;
    padding: 28px 24px 22px;
    border-radius: 22px;
    color: #fff;
    background:
        radial-gradient(circle at 85% 15%, rgba(52, 209, 107, .35), transparent 45%),
        linear-gradient(135deg, #0f3d2e, #14532d 60%, #0b2a20);
}
.eyebrow { margin: 0; font-size: 13px; opacity: .8; }
.hero h1 { margin: 6px 0 0; font-size: 22px; letter-spacing: -0.03em; }
.big {
    margin: 4px 0 14px;
    font-size: 64px;
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
    transition: opacity .15s;
}
.big.busy { opacity: .45; }
.stages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 0; padding: 0; list-style: none; }
.stages li { background: rgba(255, 255, 255, .1); border-radius: 12px; padding: 8px 10px; }
.stages span { display: block; font-size: 12px; opacity: .8; }
.stages b { font-size: 18px; font-variant-numeric: tabular-nums; }
.hero-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 16px; }
.focus { font-size: 13px; display: flex; align-items: center; gap: 8px; }
.focus select {
    font: inherit; font-size: 14px; color: var(--ink); background: var(--card);
    border: 0; border-radius: 10px; padding: 6px 10px;
}
.scenario { margin: 0; font-size: 13px; opacity: .85; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}
.card h2 { margin: 0 0 14px; font-size: 18px; letter-spacing: -0.02em; }

.opp { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.opp-col { border: 1px solid var(--line); border-radius: 14px; padding: 16px 16px 12px; background: linear-gradient(180deg, var(--bg), var(--card) 70px); }
.opp-head { display: flex; align-items: center; justify-content: space-between; }
.opp-head h3 { margin: 0; font-size: 16px; letter-spacing: -0.02em; }
.opp-head .chance { padding: 3px 10px; border-radius: 999px; font-size: 14px; font-weight: 800; color: var(--accent); background: var(--accent-soft); font-variant-numeric: tabular-nums; }
.opp-col .sub, .opp-col .none { margin: 4px 0 10px; font-size: 12px; color: var(--sub); }
.opp-list { list-style: none; margin: 0; padding: 0; }
.opp-list li { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 8px; padding: 8px 0 9px; border-top: 1px solid var(--line); }
.opp-list li:first-child { border-top: 0; }
.opp-list .t { font-size: 14px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opp-list .v { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--sub); }
.opp-list .track { grid-column: 1 / -1; height: 6px; margin-top: 7px; border-radius: 999px; background: var(--line); overflow: hidden; }
.opp-list .fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #6ee7a0); }
.opp-list .r0 .t { font-weight: 800; }
.opp-list .r0 .v { color: var(--accent); font-size: 16px; font-weight: 800; }
.opp-list .r1 .fill { opacity: .7; }
.opp-list .r2 .fill { opacity: .5; }
.opp-list .r3 .fill { opacity: .38; }

.tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; }
.tabs button {
    font: inherit; font-weight: 700; font-size: 14px;
    border: 1px solid var(--line); background: var(--card); color: var(--ink);
    border-radius: 999px; padding: 6px 14px; cursor: pointer; flex: none;
}
.tabs button.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl th, .tbl td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: center; font-size: 14px; }
.tbl thead th { font-size: 12px; color: var(--sub); font-weight: 600; }
.tbl tbody th { text-align: left; font-weight: 700; }
.tbl tr.me { background: var(--me); }
.tbl .rk { color: var(--sub); width: 40px; }
.tbl td.p { position: relative; }
.tbl td.strong { font-weight: 800; color: var(--accent); }
.tbl td .bar { position: absolute; left: 8px; right: 8px; bottom: 4px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--accent) var(--w), var(--line) var(--w)); }
.tie { margin: 10px 0 0; padding: 10px 12px; background: var(--warn-bg); color: var(--warn); border-radius: 10px; font-size: 13px; }

.games { list-style: none; margin: 14px 0 0; padding: 0; }
.games li {
    display: grid;
    grid-template-columns: 82px 1fr auto 1fr 92px;
    align-items: center;
    gap: 8px;
    padding: 10px 4px;
    border-bottom: 1px solid var(--line);
}
.games li.fixed { background: var(--me); border-radius: 10px; }
.games .md { font-size: 13px; line-height: 1.4; }
.games .md b { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; color: var(--accent); background: var(--accent-soft); }
.games .md time { font-weight: 600; color: var(--ink); opacity: .8; font-variant-numeric: tabular-nums; }
.games .md time { display: block; margin-top: 3px; }
.games .h { text-align: right; font-weight: 600; }
.games .a { font-weight: 600; }
.games .me { color: var(--accent); font-weight: 800; }
.games .score { display: flex; align-items: center; gap: 4px; }
.games input {
    width: 44px; height: 40px; text-align: center;
    font: inherit; font-size: 17px; font-weight: 700; color: var(--ink);
    background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
    -moz-appearance: textfield; appearance: textfield;
}
.games input::-webkit-outer-spin-button, .games input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.games input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.games .final { font-weight: 800; font-size: 17px; }
.games .colon { color: var(--sub); }
.games .odds { font-size: 13px; font-weight: 600; color: var(--ink); opacity: .65; text-align: right; font-variant-numeric: tabular-nums; }

.hint { font-size: 13px; color: var(--sub); margin: 12px 0 0; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.btn {
    font: inherit; font-weight: 700; font-size: 14px; cursor: pointer;
    border: 1px solid var(--brand); background: var(--brand); color: #fff;
    border-radius: 10px; padding: 9px 16px;
}
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.toast { margin: 10px 0 0; font-size: 13px; color: var(--accent); text-align: right; word-break: break-all; }

.model ol { margin: 0; padding-left: 20px; }
.model li { margin-bottom: 6px; }
.warn { background: var(--warn-bg); color: var(--warn); padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.src { font-size: 13px; color: var(--sub); margin-bottom: 0; }

.foot { padding: 24px 0 40px; color: var(--sub); font-size: 13px; text-align: center; }

@media (max-width: 640px) {
    .hero { padding: 22px 18px 18px; }
    .big { font-size: 52px; }
    .stages { grid-template-columns: repeat(3, 1fr); }
    .opp { grid-template-columns: 1fr; }
    .card { padding: 16px; }
    .games li { grid-template-columns: 1fr auto 1fr; row-gap: 2px; }
    .games .md { grid-column: 1 / -1; }
    .games .md time { display: inline; margin: 0 0 0 6px; }
    .games .odds { grid-column: 1 / -1; text-align: center; }
}

.btn.light { background: #fff; color: var(--brand); border-color: #fff; margin-left: auto; }
.card-dialog {
    border: 0; border-radius: 20px; padding: 20px; width: min(92vw, 520px);
    background: var(--card); color: var(--ink);
}
.card-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.card-dialog h2 { margin: 0 0 12px; font-size: 18px; }
.card-dialog img { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain; border-radius: 12px; background: var(--bg); }
.card-dialog .actions { margin-top: 14px; }
a.btn { text-decoration: none; display: inline-block; }
@media (max-width: 640px) { .btn.light { margin-left: 0; width: 100%; } }

.flag {
    display: inline-block; width: 20px; height: 15px; margin-right: 6px;
    vertical-align: -2px; border-radius: 2px; object-fit: cover;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .12);
}
.games .h .flag { margin: 0 0 0 6px; }

/* 토너먼트 시뮬레이션 */
.hint.lead { margin: -6px 0 12px; }
.actions.left { justify-content: flex-start; margin-top: 0; }
.ko-champ { margin: 18px 0 12px; font-size: 20px; font-weight: 800; }
.ko-champ strong { color: var(--accent); }
.ko-champ .flag { width: 28px; height: 21px; vertical-align: -3px; }
.ko-groups { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 12px; margin-bottom: 18px; align-items: start; }
.ko-box { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ko-box h3 { margin: 0; padding: 9px 14px; font-size: 13px; color: var(--sub); background: var(--bg); border-bottom: 1px solid var(--line); }
.ko-res { list-style: none; margin: 0; padding: 0; }
.ko-res li { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 8px 12px; font-size: 14px; border-bottom: 1px solid var(--line); }
.ko-res li:last-child { border-bottom: 0; }
.ko-res .h { text-align: right; }
.ko-res .h .flag { margin: 0 0 0 6px; }
.ko-res .s { min-width: 54px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.ko-res .s small { display: block; font-size: 10px; font-weight: 600; color: var(--sub); }
.ko-res .me { color: var(--accent); font-weight: 700; }
.ko-rt { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.ko-rt th, .ko-rt td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.ko-rt td + td, .ko-rt th + td { border-left: 1px solid var(--line); }
.ko-rt thead th { font-size: 12px; font-weight: 600; color: var(--sub); }
.ko-rt thead th + th { border-left: 1px solid var(--line); }
.ko-rt tbody tr:last-child > * { border-bottom: 0; }
.ko-rt tbody th { width: 44px; color: var(--sub); font-weight: 700; }
.ko-rt tr.cur { background: var(--me); }
.ko-rt .me { color: var(--accent); font-weight: 700; }
.ko-rt .out { color: var(--sub); }
.ko-rt .out .flag { opacity: .5; }
.ko-rt em { margin-left: 6px; padding: 1px 6px; border-radius: 999px; font-size: 10px; font-style: normal; font-weight: 700; vertical-align: 1px; }
.ko-rt em.adv { color: var(--accent); background: var(--accent-soft); }
.ko-rt em.drop { color: var(--sub); background: var(--bg); border: 1px solid var(--line); }
.bracket { display: grid; grid-template-columns: repeat(4, minmax(200px, 1fr)); gap: 12px; min-width: 840px; }
.ko-col { display: flex; flex-direction: column; }
.ko-list { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 10px; }
.ko-col h3 { margin: 0 0 10px; text-align: center; }
.ko-col h3 span { font-size: 15px; font-weight: 800; color: var(--ink); }
.ko-m { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.ko-t {
    display: flex; align-items: center; gap: 6px; width: 100%;
    font: inherit; font-size: 15px; color: var(--ink); text-align: left;
    background: transparent; border: 0; padding: 9px 12px; cursor: pointer;
}
.ko-t + .ko-t { border-top: 1px solid var(--line); }
.ko-t:hover { background: var(--bg); }
.ko-t:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ko-t .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ko-t .pr { font-size: 13px; font-weight: 600; color: var(--ink); opacity: .6; font-variant-numeric: tabular-nums; }
.ko-t .sc { width: 26px; text-align: right; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ko-t.win { font-weight: 800; }
.ko-t.win .pr { opacity: .8; }
.ko-t.win .sc { color: var(--accent); }
.ko-t.lose { color: var(--sub); }
.ko-t.lose .flag { opacity: .55; }
.ko-t.me .nm { color: var(--accent); }
.ko-t[aria-pressed="true"] { background: var(--accent-soft); }
.ko-note {
    position: absolute; right: 46px; top: 50%; transform: translateY(-50%);
    font-size: 10px; font-weight: 700; color: var(--warn); background: var(--warn-bg);
    padding: 1px 6px; border-radius: 999px; pointer-events: none;
}
.ko-note.pick { color: var(--accent); background: var(--accent-soft); }
@media (max-width: 640px) {
    .ko-groups { grid-template-columns: 1fr; }
}

.top-right { display: flex; align-items: center; gap: 8px; }
.theme-btn {
    width: 34px; height: 34px; border: 0; border-radius: 999px; cursor: pointer;
    font-size: 16px; line-height: 1; background: rgba(255, 255, 255, .14);
}
.theme-btn:hover { background: rgba(255, 255, 255, .24); }
.theme-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* 어두운 화면에서는 진한 초록 버튼이 배경에 묻혀서 밝은 초록으로 바꿔요 */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .btn:not(.ghost):not(.light),
    :root:not([data-theme="light"]) .tabs button.on { background: var(--accent); border-color: var(--accent); color: #062012; }
}
:root[data-theme="dark"] .btn:not(.ghost):not(.light),
:root[data-theme="dark"] .tabs button.on { background: var(--accent); border-color: var(--accent); color: #062012; }

/* 상단 대회 메뉴 */
.top .wrap { gap: 12px; }
.menu { display: flex; gap: 4px; margin-right: auto; margin-left: 12px; overflow-x: auto; scrollbar-width: none; }
.menu::-webkit-scrollbar { display: none; }
.menu a {
    flex: none; padding: 6px 12px; border-radius: 999px;
    font-size: 14px; font-weight: 700; color: rgba(255, 255, 255, .7); text-decoration: none;
}
.menu a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.menu a[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, .16); }
@media (max-width: 640px) {
    .top .wrap { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 8px; row-gap: 6px; }
    .menu { order: 3; width: 100%; margin: 0 -4px; }
    .top-right { margin-left: auto; }
}

/* K리그 */
.stages.six { grid-template-columns: repeat(6, 1fr); }
.hero-note { margin: 12px 0 0; font-size: 13px; padding: 8px 12px; border-radius: 10px; background: rgba(0, 0, 0, .18); }
.split-title { margin: 18px 0 8px; font-size: 16px; }
.split-title:first-child { margin-top: 4px; }
.split-title small { font-size: 12px; font-weight: 600; color: var(--sub); margin-left: 4px; }
.lg-tbl td.p { font-size: 13px; }
.lg-tbl td.nil { color: var(--sub); opacity: .5; }
.lg-tbl .strong-n { font-weight: 800; }
.lg-tbl .pc.z-acl { background: rgba(22, 163, 74, .10); }
.lg-tbl .pc.z-aclpo { background: rgba(22, 163, 74, .05); }
.lg-tbl .pc.z-rpo { background: rgba(220, 38, 38, .10); }
.pick-team { font: inherit; font-weight: 700; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.pick-team:hover { color: var(--accent); text-decoration: underline; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 12px 0 0; font-size: 12px; color: var(--sub); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
.legend .z-acl::before { background: rgba(22, 163, 74, .45); }
.legend .z-aclpo::before { background: rgba(22, 163, 74, .22); }
.legend .z-rpo::before { background: rgba(220, 38, 38, .45); }
@media (max-width: 640px) {
    .stages.six { grid-template-columns: repeat(3, 1fr); }
}

/* 소개·개인정보처리방침 같은 글 페이지 */
.prose { line-height: 1.75; }
.prose h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: -0.02em; }
.prose h2 { margin: 26px 0 8px; font-size: 17px; }
.prose p, .prose li { color: var(--ink); font-size: 15px; }
.prose ul, .prose ol { padding-left: 20px; }
.prose .meta { margin-top: 0; color: var(--sub); font-size: 13px; }
.foot nav { margin-top: 8px; }
.foot nav a { color: var(--sub); margin: 0 8px; }
