:root {
    --bg: #0f1115;
    --panel: #1a1d24;
    --panel2: #21252e;
    --text: #e6e6e6;
    --muted: #9aa0ab;
    --accent: #ff4655; /* 발로란트 레드 */
    --green: #4ade80;
    --red: #f87171;
    --border: #2c3038;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", "Malgun Gothic", system-ui, sans-serif;
    font-size: 14px;
}
header { border-bottom: 1px solid var(--border); background: var(--panel); }
nav { display: flex; gap: 18px; align-items: center; padding: 12px 20px; max-width: 1100px; margin: 0 auto; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--text); }
nav .brand { color: var(--accent); font-weight: 700; margin-right: auto; }
main { max-width: 1100px; margin: 0 auto; padding: 20px; }
h1, h2, h3 { font-weight: 600; }
a { color: #7db3ff; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 20px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
tr:hover td { background: var(--panel2); }
.team-A { border-left: 3px solid var(--green); }
.team-B { border-left: 3px solid var(--red); }
.team-dot { display: inline-block; width: 11px; height: 11px; border-radius: 2px; vertical-align: baseline; margin: 0 4px; }
.team-dot-A { background: var(--green); }
.team-dot-B { background: var(--red); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; background: var(--panel2); }
.badge.warn { background: #4a2c00; color: #ffb84d; }
.notice-dup { border-left: 3px solid #ffb84d; background: #2a2110; }
.score { font-weight: 700; }
.bar-wrap { background: var(--panel2); border-radius: 4px; height: 14px; position: relative; min-width: 80px; }
.bar { background: var(--accent); height: 100%; border-radius: 4px; }
input, select, button {
    background: var(--panel2); color: var(--text); border: 1px solid var(--border);
    border-radius: 5px; padding: 6px 8px; font-size: 13px;
}
input.narrow { width: 62px; }
/* 검토 테이블: 12개 열이 넓어 페이지를 넘으므로 가로 스크롤로 가둔다. */
.table-scroll { overflow-x: auto; }
.table-scroll table { min-width: max-content; }
.table-scroll th, .table-scroll td { padding: 6px 6px; white-space: nowrap; vertical-align: middle; }
/* 숫자 헤더는 .num 으로 우측정렬되어 있지만 아래 입력창은 좌측에 놓여 어긋나 보인다.
   검토표에서는 헤더 라벨을 입력창과 같은 왼쪽 기준으로 맞춘다. */
.table-scroll th.num { text-align: left; }
.table-scroll input.narrow { width: 46px; }
.table-scroll input, .table-scroll select { padding: 5px 6px; }
button { background: var(--accent); color: #fff; border: none; cursor: pointer; font-weight: 600; }
button.ghost { background: var(--panel2); color: var(--text); }
button.danger { background: var(--red); color: #1a1a1a; }
button:hover { opacity: 0.9; }
form.inline { display: inline; }
form.stack { display: flex; flex-direction: column; gap: 10px; max-width: 320px; }
form.stack label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 13px; }
form.stack input { width: 100%; }
.nav-user { color: var(--text); font-size: 13px; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .chk { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; }
.toolbar .chk input { width: auto; }
.lb-head { display: flex; align-items: center; justify-content: space-between; }
.lb-filter { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lb-filter-left, .lb-filter-right { display: flex; align-items: flex-end; gap: 12px; }
th.sortable a { color: inherit; text-decoration: none; cursor: pointer; white-space: nowrap; }
th.sortable a:hover { text-decoration: underline; }
.sort-toggle { display: flex; gap: 8px; }
.btn-sort {
    display: inline-block; min-width: 44px; padding: 10px 18px; border-radius: 6px;
    background: var(--panel2); color: var(--text); text-decoration: none;
    font-size: 18px; font-weight: 700; line-height: 1; text-align: center;
    border: 1px solid var(--border);
}
.btn-sort.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-sort:hover { opacity: 0.9; }
/* 경기 상세 '수정' 버튼: 접힌 상태에서도 버튼처럼 보이게 summary 를 꾸민다. */
.edit-box { margin: 10px 0; }
.edit-box > summary {
    display: inline-block; list-style: none; cursor: pointer;
    background: var(--accent); color: #fff; font-weight: 600;
    padding: 7px 14px; border-radius: 5px; user-select: none;
}
.edit-box > summary::-webkit-details-marker { display: none; }
.edit-box > summary::before { content: "\270E  "; }
.edit-box[open] > summary { background: var(--panel2); color: var(--text); border: 1px solid var(--border); }
.edit-box[open] > summary::before { content: "\2715  "; }
.edit-box > summary:hover { opacity: 0.9; }
.edit-box .inline { display: block; margin-top: 12px; }
.edit-box .inline label { margin-right: 10px; }
.muted { color: var(--muted); }
/* 일반 유저 '내 정보' 카드: 라벨/값 2열 정의 목록. */
.info { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 8px 0 14px; max-width: 420px; }
.info > div { display: contents; }
.info dt { color: var(--muted); }
.info dd { margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.pos { color: var(--green); }
.neg { color: var(--red); }
canvas { max-width: 100%; }

/* ===== 인라인 style 대체용 공통 클래스 ===== */
.panel.narrow { max-width: 560px; }
.panel.narrow-sm { max-width: 460px; }
.panel.accent-border { border-color: var(--accent); }
.panel.danger-border { border-color: var(--red); }
.panel.ok-border { border-color: var(--green); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head > h2 { margin: 0; }
.notice-ok { margin: 8px 0 0; padding: 6px 10px; border-left: 3px solid var(--green); background: #12240f; }
.notice-inline { padding: 8px 10px; border-radius: 6px; }
.hint-sub { font-size: 0.8em; }
.center { text-align: center; }
.m-0 { margin: 0; }
.my-10 { margin: 10px 0; }
.mt-6 { margin-top: 6px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.mb-10 { margin-bottom: 10px; }
.cap { text-align: center; margin: 4px 0 0; }
.mb-6 { margin: 0 0 6px; }
.pl-18 { padding-left: 18px; }
.w-56 { width: 56px; }
.w-90 { width: 90px; }
.w-110 { width: 110px; }
.w-130 { width: 130px; }
.w-160 { width: 160px; }
.w-180 { width: 180px; }

/* players: Riot ID 칩 (구 인라인 <style> 이전) */
.riot-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px;
    margin: 1px 3px 1px 0; border: 1px solid var(--border); border-radius: 10px;
    font-size: 0.85em; white-space: nowrap; }
.riot-chip .chip-x { background: none; border: none; color: var(--red); cursor: pointer;
    padding: 0 2px; font-size: 1.1em; line-height: 1; }
.riot-cell { min-width: 210px; }
.riot-add-form { display: inline-flex; gap: 3px; margin-top: 2px; }
.nick-preview { font-size: 12px; margin-top: 2px; }

/* ===== 모바일(좁은 화면) 반응형 ===== */
@media (max-width: 640px) {
    body { font-size: 13px; }
    /* 상단 내비: 브랜드는 한 줄 차지하고 링크는 아래로 줄바꿈 */
    nav { flex-wrap: wrap; gap: 8px 14px; padding: 10px 14px; }
    nav .brand { margin-right: 0; flex-basis: 100%; }
    main { padding: 14px 12px; }
    /* 2단 그리드는 세로 1단으로 */
    .grid2 { grid-template-columns: 1fr; gap: 14px; }
    .panel { padding: 12px; }
    /* 표가 좁은 화면에서 셀 글자가 세로로 접히는 문제 방지:
       셀은 한 줄로 유지하고, 넘치면 패널 안에서 가로 스크롤. */
    .panel { overflow-x: auto; }
    .panel table { min-width: max-content; }
    .panel th, .panel td { white-space: nowrap; padding: 6px 8px; }
    /* 필터/툴바는 세로로 쌓아 넘침 방지 */
    .toolbar { gap: 8px; }
    .lb-head { flex-wrap: wrap; gap: 8px; }
    .lb-filter { flex-direction: column; align-items: stretch; }
    .lb-filter-left, .lb-filter-right { flex-wrap: wrap; }
    /* '내 정보' 정의목록은 라벨/값 1열로 */
    .info { grid-template-columns: 1fr; gap: 2px 0; }
    .info dt { margin-top: 8px; }
}
