:root {
    --bg: #f2f3f5;
    --panel: #ffffff;
    --line: #e1e3e8;
    --line2: #a3a3a3;
    --gray: #f8f9fa;
    --gray2: #e0e0e0;
    --gray3: #6c757d;
    --green: #90ee90;
    --beige: #d3b7a5;
    --muted: #97989a;
    --radius: 12px;
    --chip-radius: 8px;
    --gap: 6px;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    margin: 0;
    background: var(--bg);
    color: #222;
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
    font-weight: 400;
    min-width: 1280px;
    min-height: 800px;
}

.position-r {
    position: relative;
}

.page {
    width: 100vw;
    height: 100vh;
    box-sizing: border-box;
    padding: 0;
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
    min-height: 800px;
}

/* ========== 헤더 ========== */
.topbar-wrap {
    min-width: 1280px;
    width: 100%;
}

.topbar {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    box-sizing: border-box;
}

.logo {
    width: 50px;
    height: 50px;
    color: #fff;
    font-weight: 800;
    display: grid;
    place-items: center;
}

.title-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
}

.title {
    font-weight: 700;
    font-size: 18px;
}

.subtitle {
    color: var(--muted);
    font-size: 18px;
}

.text-muted {
    color: var(--muted);
}

/* ========== 본문 ========== */
.board-wrap {
    min-width: 1280px;
    width: 100%;
    height: 100%;
    display: grid;
    padding: 12px;
    box-sizing: border-box;
    overflow: hidden;
}

.board {
    display: grid;
    grid-template-columns: 2.5fr 4.5fr 3fr;
    gap: var(--gap);
    min-height: 0;
    height: 120%;
    justify-items: stretch;
    align-items: stretch;
}

/* 카드 공통 */
.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 0;
}

.card.darkline {
    border-color: #000;
}

.card.darkline .card-head {
    background: linear-gradient(180deg, #165b77, #0c252b);
    border-bottom: 1px solid #555;
    color: white;
}

.card.darkline .card-body {
    background: white;
}

.card-head {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    font-weight: 700;
    background: var(--gray);
    flex: 0 0 auto;
}

.card-body{
    flex:1 1 auto;
    min-height:0;
    padding:12px;
    overflow:auto; 
    scrollbar-width:thin;
}

.card-body::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.card-body::-webkit-scrollbar-thumb {
    background: #cfd3da;
    border-radius: 8px;
}

/* 우측 칼럼: Check-in / Out */
.right-col {
    display: grid;
    grid-template-rows: 2fr 1fr;
    gap: var(--gap);
    min-height: 0;
    height: 100%;
    max-height: calc(100vh - 160px);
}

/* 1280 미만으로 뷰포트가 줄어들면 수평 스크롤(요구: 최소 1280 유지) */
@media (max-width:1279.98px) {
    .page {
        overflow: auto;
    }
}

/* 800px 미만으로 뷰포트가 줄어들면 세로 스크롤(요구: 최소 800px 유지) */
@media (max-height:799.98px) {
    .page {
        overflow: auto;
    }
}

@media (max-height:600px) {
    .board-wrap {
        height: calc(100vh - 80px);
    }

    .card {
        max-height: calc(100vh - 120px);
    }

    .card-body {
        max-height: calc(100vh - 160px);
    }

    .right-col {
        max-height: calc(100vh - 120px);
    }
}

/*진행중*/
.demo {
    margin-bottom: 8px;
    padding: 0;
}

/* === 카드 === */
.match-card {
    border-radius: 8px;
    min-width: 285px;
    width: 100%;
    background: var(--panel);
    border: 1px solid var(--line2);
    box-sizing: border-box;
    overflow: hidden;
    display: grid;
    grid-template-columns: auto 1fr;
}

/* 왼쪽 라벨(세로 글씨) */
.lane {
    display: grid;
    place-items: center;
    padding: 8px 3px;
    min-width: 20px;
    border-right: 1px solid var(--line2);
}

.lane.green {
    background: var(--success);
}

.lane.beige {
    background: var(--success);
}

.lane.darkgray {
    background: var(--gray3);
}

.lane b {
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-weight: 700;
    font-size: 14px;
    color: #1a1a1a;
    letter-spacing: 0.05em;
}

.lane.beige b,
.lane.darkgray b {
    writing-mode: horizontal-tb;
    color: #fff;
}

.board-list {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: center;
    padding: 8px;
    background-color: var(--gray);
}

.team {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 6px;
}

.team.vertical {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
    gap: 6px;
    background-color: white;
}
.chip {
    display: flex;
    justify-content: center;
    grid-template-columns: auto 1fr;
    gap: 6px;
    align-items: center;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--chip-radius);
    background: #fff;
    min-width: 104px;
    min-height: 46px;
    box-sizing: border-box;
}

.chip.blank {
    background-color: var(--gray2);
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #ddd;
}

.who {
    line-height: 1.2;
}

.name {
    font-weight: 700;
    font-size: 14px;
}

.grade {
    color: var(--muted);
    font-size: 11px;
}

span.point {
    color: #48c775;
    font-weight: bold;
    font-size: 12px;
    margin-left: 3px;
}

.vs {
    font-weight: 700;
    color: #222;
    font-size: 16px;
}

.btn-filter {
    background: none;
    border: none;
    color: #222222;
    font-size: 14px;
    font-weight: 500;
    padding: 0px 3px;
    margin-top: -5px;
    margin-bottom: 5px;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
    min-height: 36px;
}

.btn-filter img {
    width: 18px;
    flex-shrink: 0;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    background: #eee;
    color: #444;
    border-radius: 999px;
    padding: 0 10px;
    font-size: 13px;
    margin-right: 4px;
    margin-bottom: 2px;
    height: 24px;
}

.filter-tag-x {
    margin-left: 6px;
    cursor: pointer;
    font-weight: bold;
    color: #888;
    font-size: 15px;
    line-height: 1;
}

.badge-img.guest {
    position: absolute;
    bottom: 3px;
    left: 26px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-image: url("../assets/images/ico_badge_guest.png");
    background-size: cover;
    background-repeat: no-repeat;
}