:root {
    --color-bg: #f2f4f6;
    --color-surface: #ffffff;
    --color-text: #333840;
    --color-text-fixed: #333840;
    --color-muted: #646a73;
    --color-border: #dfe3e8;
    --color-border-soft: #b5b5b5;
    --color-fill: #f5f6f8;
    --color-primary: #00873f;
    --color-primary-dark: #00773a;
    --color-primary-soft: #e9fbef;
    --color-primary-outline: #b9d5c3;
    --color-primary-hover: #00773a;
    --color-head-bg: #f7f8fa;
    --color-line-soft: #f0f1f3;
    --color-fill-soft: #fafbfc;
    --color-fill-strong: #eef0f3;
    --color-accent: #de2b39;
    --color-error: #c0212f;
    --color-error-soft: #fdeceb;
    --color-live-soft: #fff7f7;
    --color-live: #de2b39;
    --color-footer: #101010;
    --color-finished: #555555;
    --color-scheduled: #b5b8bf;
    --color-form-draw: #646a73;
    --color-online: #2fb344;
    --color-black: #000000;
    --color-blue: #2f6fe0;
    --color-blue-soft: #e7efff;
    --color-gold: #a26a00;
    --color-gold-soft: #fff4d1;
    --color-primary-deep: #005c2b;
    --color-count: #000000;
}

/* 윈도우 10 이모지 글꼴에 없는 새 이모지만 채움, COLRv1 못 그리는 사파리는 건너뜀 */
@font-face {
    font-family: "Noto Emoji New";
    src: url("/fonts/notoemoji/noto-emoji-new-f105cb0e6f83cffc606aa85917696d5e.woff2") format("woff2") tech(color-COLRv1);
    font-display: swap;
    unicode-range: U+26A7, U+1F6D6-1F6D8, U+1F6DC-1F6DF, U+1F6FB-1F6FC, U+1F7F0, U+1F90C, U+1F972, U+1F977-1F979, U+1F9A3-1F9A4, U+1F9AB-1F9AD, U+1F9CB-1F9CC, U+1FA74-1FA77, U+1FA7B-1FA7C, U+1FA83-1FA8A, U+1FA8E-1FA8F, U+1FA96-1FAC6, U+1FAC8, U+1FACD-1FADC, U+1FADF-1FAEA, U+1FAEF-1FAF8;
}

* {
    box-sizing: border-box;
}

/* 아이폰에서 바닥 너머로 당길 때 흰 바탕 안 보이게 */
html {
    background: var(--color-footer);
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    margin: 0;
    font-family: "Paperlogy Variable", "Noto Emoji New", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
    font-size: 13px;
    background: var(--color-bg);
    color: var(--color-text);
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    z-index: 1000;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--color-primary-dark);
    color: #ffffff;
    font-weight: 700;
}

.skip-link:focus {
    top: 8px;
}

.site-body:focus {
    outline: none;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.inner {
    width: 100%;
    max-width: 1392px;
    margin: 0 auto;
    padding: 0 24px;
}

.header-top {
    display: flex;
    align-items: center;
    height: 64px;
    gap: 32px;
}

.logo {
    flex: none;
}

.logo img {
    display: block;
    width: auto;
    height: 40px;
}

.gnb {
    display: flex;
    gap: 4px;
}

.gnb a {
    padding: 8px 12px;
    color: var(--color-muted);
    font-size: 15px;
    font-weight: 600;
}

.gnb a.active,
.gnb a:hover {
    color: var(--color-primary-dark);
    text-decoration: none;
}

.header-top > .gnb {
    align-self: stretch;
}

.header-top > .gnb > a,
.header-top .gnb-item > a {
    display: flex;
    position: relative;
    align-items: center;
    height: 100%;
}

.header-top > .gnb a.active::after {
    content: "";
    position: absolute;
    right: 12px;
    bottom: 0;
    left: 12px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--color-primary);
}

.header-top .gnb-item > a::before {
    content: "";
    position: absolute;
    top: 0;
    right: -2px;
    bottom: 0;
    left: -2px;
}

.gnb-item {
    position: relative;
}

.gnb-item > a {
    display: block;
}

.gnb-sub {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 31;
    min-width: 140px;
    padding: 6px 0;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.gnb-item:hover .gnb-sub,
.gnb-item:focus-within .gnb-sub {
    display: block;
}

.gnb-sub a {
    display: block;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
}

.gnb-sports {
    padding: 12px 6px;
    white-space: nowrap;
}
/*@media (max-width: 1124px) {*/
/*    .gnb-sports {*/
/*        left: -100px;*/
/*    }*/
/*}*/
@media (min-width: 1024px) and (max-width: 1135px) {
    .header-top {
        position: relative;
    }

    .header-top .gnb-item:has(> .gnb-sports) {
        position: static;
    }

    .header-top .gnb-sports {
        right: 24px;
        left: auto;
    }
}
@media (min-width: 1061px) and (max-width: 1135px) {
    .header-top .gnb > .gnb-item:nth-of-type(1):has(> .gnb-sports) {
        position: relative;
    }
    .header-top .gnb > .gnb-item:nth-of-type(1) > .gnb-sports {
        right: auto;
        left: 0;
    }
}

.gnb-sport {
    display: inline-block;
    min-width: 130px;
    padding: 0 6px;
    vertical-align: top;
}

.gnb-sport + .gnb-sport {
    border-left: 1px solid var(--color-line-soft);
}

.gnb-sport > a:first-child {
    margin-bottom: 4px;
    color: var(--color-text);
    font-weight: 700;
}

.gnb-sub .gnb-league {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 400;
}

.member-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    font-size: 13px;
}

.btn-signup,
.btn-login,
.logout-form button {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: var(--color-fill);
    color: var(--color-text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.btn-signup {
    color: var(--color-primary-dark);
}

.btn-signup:hover,
.btn-login:hover {
    text-decoration: none;
}

.box {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
}

.box-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    padding: 0 20px;
    border-bottom: 1px solid var(--color-border);
    flex-wrap: wrap;
}

.box-head > strong,
.box-head > h2,
.mypage-form > h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.box-head a {
    color: var(--color-muted);
    font-size: 13px;
}

.box-head > a::after {
    content: " ›";
}

/* 홈 */
.hm {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hm > .auth-notice {
    margin: 0;
}

.hm h2,
.hm-standings h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}

.hm-standings h2 {
    font-size: 16px;
}

.hm .box-head {
    height: 54px;
}

.hm svg,
.hm-standings svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hm-ic {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    color: var(--color-muted);
    vertical-align: -3px;
}

.hm-red {
    color: var(--color-muted);
}

.hm-games-more {
    display: block;
    padding: 10px 16px;
    border-top: 1px solid var(--color-border);
    color: var(--color-muted);
    font-size: 13px;
    text-align: center;
}

.hm-games-more[hidden] {
    display: none;
}

.hm-empty {
    margin: 0;
    padding: 28px 16px;
    color: var(--color-muted);
    text-align: center;
}

.hm-empty a {
    color: var(--color-primary-dark);
    font-weight: 700;
}

/* 오른쪽 열에 채팅 아래 순위표를 하나 더 쌓음 */
.site-body:has(> .hm-standings) {
    grid-template-rows: auto auto 1fr;
}

.site-body:has(> .hm-standings) > main {
    grid-row: 1 / span 3;
}

.hm-standings {
    grid-column: 2;
    margin-top: 12px;
}

/* 홈은 아래에 순위표가 있어 채팅을 따라붙이지 않고 높이를 고정, 끌어 바꾼 높이는 인라인으로 우선 */
@media (min-width: 1024px) {
    .site-body:has(> main.hm) .chat-dock {
        position: static;
    }

    .site-body:has(> main.hm) .chat-dock .chat {
        height: 560px;
        max-height: none;
    }
}

.hm-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 46px;
    padding: 0 8px 0 10px;
    overflow: hidden;
}

.hm-notice-label {
    flex: none;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--color-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.hm-notice ul {
    display: flex;
    flex: 1;
    gap: 22px;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.hm-notice li {
    display: flex;
    gap: 6px;
    min-width: 0;
}

.hm-notice li a {
    overflow: hidden;
    text-overflow: ellipsis;
}

.hm-notice time {
    color: var(--color-muted);
    font-size: 12px;
}

.hm-notice-more {
    display: grid;
    flex: none;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 16px;
}

.hm-live-badge,
.hm-onair {
    padding: 1px 7px;
    border-radius: 4px;
    background: var(--color-live);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
}

.hm-sports {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    padding: 14px 12px 0;
    border-bottom: 1px solid var(--color-border);
}

.hm-sports button {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 0 12px;
    border: 0;
    background: none;
    color: var(--color-muted);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.hm-sports svg {
    width: 34px;
    height: 34px;
}

.hm-sports em {
    position: absolute;
    top: 2px;
    line-height: 14px;
    left: calc(50% + 12px);
    padding: 0 6px;
    border-radius: 999px;
    background: var(--color-fill);
    color: var(--color-text);
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
}

.hm-sports button.active {
    color: var(--color-primary-dark);
}

.hm-sports button.active svg {
    color: var(--color-primary);
}

.hm-sports button.active em {
    background: var(--color-primary);
    color: #fff;
}

.hm-sports button.active::after {
    content: "";
    position: absolute;
    right: 18%;
    bottom: -1px;
    left: 18%;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--color-primary);
}

.hm-filter {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 12px 16px 0;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--color-fill);
    color: var(--color-muted);
    font-size: 12px;
}

.hm-filter button {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.hm-filter button::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    border: 1.5px solid var(--color-scheduled);
    border-radius: 50%;
    vertical-align: -2px;
}

.hm-filter button.active {
    color: var(--color-text);
    font-weight: 700;
}

.hm-filter button.active::before {
    border: 4px solid var(--color-primary);
}

.hm-filter select {
    height: 28px;
    margin-left: auto;
    padding: 0 8px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
}

.hm-feature {
    padding: 12px 16px;
}

.hm-feature[hidden],
.hm-st-leagues[hidden] {
    display: none;
}

.hm-match {
    display: block;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
}

.hm-match:hover {
    border-color: var(--color-primary);
    text-decoration: none;
}

.hm-match .sg-periods-wrap {
    margin-top: 10px;
}

.hm-state {
    margin-left: auto;
    color: var(--color-muted);
    font-size: 12px;
    font-weight: 700;
}

.hm-match-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hm-league {
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--color-blue-soft);
    color: var(--color-blue);
    font-size: 12px;
    font-weight: 700;
}

.hm-clock {
    font-size: 16px;
}

.hm-onair {
    margin-left: auto;
}

.hm-scoreline {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    margin: 12px 0 10px;
}

.hm-team {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 15px;
    font-weight: 700;
}

.hm-team--away {
    justify-content: flex-end;
}

.hm-team img {
    flex: none;
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.hm-team span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hm-score {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 2px;
}

.hm-score b {
    color: var(--color-muted);
    font-weight: 600;
}

.hm-score em,
.hm-sc em {
    color: var(--color-live);
    font-style: normal;
}

.hm-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 12.5px;
}

.hm-table th,
.hm-table td {
    height: 38px;
    padding: 0 8px;
    border-bottom: 1px solid var(--color-line-soft);
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hm-table th {
    height: 34px;
    background: var(--color-head-bg);
    color: var(--color-muted);
    font-weight: 400;
}

.hm-table tbody tr:last-child td {
    border-bottom: 0;
}

.hm-table .left {
    text-align: left;
}

.hm-table .right {
    text-align: right;
}

.hm-sc {
    font-weight: 700;
}

.hm-phase,
.sg-phase {
    display: block;
    color: var(--color-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.3;
    text-align: center;
}

.hm-games {
    border-top: 1px solid var(--color-border);
}

.hm-games th:nth-child(1) {
    width: 92px;
}

.hm-games th:nth-child(2) {
    width: 100px;
}

.hm-badge {
    width: 18px;
    height: 18px;
    margin: 0 6px;
    object-fit: contain;
    vertical-align: -4px;
}

.hm-games th:nth-child(3) {
    width: 86px;
}

.hm-games th:nth-child(5) {
    width: 84px;
}

.hm-lg {
    display: inline-block;
    width: 74px;
    padding: 3px 0;
    border-radius: 4px;
    background: var(--color-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.hm-games tr[data-href] {
    cursor: pointer;
}

.hm-games tr[data-href]:hover td {
    background: var(--color-head-bg);
}

.hm-tabs {
    display: flex;
    gap: 4px;
    min-width: 0;
    overflow-x: auto;
}
.hm-tabs::-webkit-scrollbar {
    width: 2px;
    height: 2px;
}
.hm-tabs::-webkit-scrollbar-track {
    background: transparent;
}
.hm-tabs::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #cdd2da;
}
.hm-tabs::-webkit-scrollbar-thumb:hover {
    background: #aeb4be;
}
:root[data-theme="dark"] .hm-tabs::-webkit-scrollbar-thumb {
    background: #4a4f57;
}
:root[data-theme="dark"] .hm-tabs::-webkit-scrollbar-thumb:hover {
    background: #646a73;
}

.hm-tabs button {
    padding: 5px 10px;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--color-muted);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.hm-tabs button:hover {
    color: var(--color-text);
}

.hm-tabs button.active {
    background: var(--color-primary-soft);
    color: var(--color-primary-dark);
    font-weight: 700;
}

.hm-results th:nth-child(1) {
    width: 60px;
}

.hm-results th:nth-child(2) {
    width: 150px;
}

.hm-results th:nth-child(4) {
    width: 80px;
}

.hm-results tr[data-href] {
    cursor: pointer;
}

.hm-results tr[data-href]:hover td {
    background: var(--color-head-bg);
}

.hm-results td a:hover {
    text-decoration: none;
}

.hm-vs {
    color: var(--color-muted);
    font-weight: 400;
}

.hm-win {
    color: var(--color-live);
    font-weight: 700;
}

/* 이름 길이와 상관없이 순위끼리 세로줄이 맞게 칸 너비를 고정 */
.hm-place {
    display: inline-block;
    width: 33%;
    overflow: hidden;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.hm-place i {
    margin-right: 4px;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--color-fill);
    color: var(--color-muted);
    font-size: 11px;
    font-style: normal;
    font-weight: 600;
}

.hm-place-name {
    align-self: center;
    margin-left: 4px;
    font-weight: 400;
}

/* 전체 탭 구기 줄도 점수가 같은 세로줄에 서게 홈·원정 칸 너비를 고정 */
.hm-all-team {
    display: inline-block;
    width: calc(50% - 40px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.hm-all-match .hm-sc {
    display: inline-block;
    width: 64px;
    text-align: center;
    vertical-align: middle;
}

.hm-place:first-child i {
    background: var(--color-gold-soft);
    color: var(--color-gold);
}

.hm-posts li {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 20px;
    border-bottom: 1px solid var(--color-line-soft);
    white-space: nowrap;
}

.hm-posts li:last-child {
    border-bottom: 0;
}

.hm-posts li.hm-empty {
    justify-content: center;
    height: auto;
}

.hm-posts a {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hm-posts em {
    flex: none;
    color: var(--color-live);
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
}

.hm-posts time {
    flex: none;
    width: 40px;
    margin-left: auto;
    color: var(--color-muted);
    font-size: 12px;
    text-align: right;
}

.hm-split {
    display: grid;
    gap: 12px;
}

.hm-community {
    min-width: 0;
}

.hm-winner {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}
.hm-winner > p{
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hm-winners b {
    color: var(--color-gold);
    font-size: 13px;
}

@media (min-width: 1024px) {
    .hm-split {
        grid-template-columns: 1fr 1fr;
    }
}

.hm-winners .hm-posts time {
    display: block;
}

.hm-cat {
    flex: none;
    min-width: 40px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--color-fill);
    color: var(--color-muted);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.hm-cat--notice {
    background: var(--color-error-soft);
    color: var(--color-live);
}

.hm-coupon {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 18px 24px;
    border-radius: 12px;
    background: linear-gradient(90deg, var(--color-primary-deep), var(--color-primary));
    color: #fff;
}

.hm-coupon-title strong {
    display: block;
    font-size: 20px;
    font-weight: 700;
}

.hm-coupon-title span {
    font-size: 11px;
    letter-spacing: .08em;
    opacity: .8;
}

.hm-coupon-point {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding-left: 28px;
    border-left: 1px solid rgba(255, 255, 255, .25);
}

.hm-coupon-point span {
    font-size: 13px;
    opacity: .85;
}

.hm-coupon-point strong {
    font-size: 30px;
    font-weight: 700;
}

.hm-coupon-btn {
    margin-left: auto;
    padding: 11px 18px;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 8px;
    font-weight: 700;
    white-space: nowrap;
}

.hm-coupon-btn:hover {
    background: rgba(255, 255, 255, .12);
    text-decoration: none;
}

.hm-st-sports {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    padding: 10px 8px 0;
}

.hm-st-sports button,
.hm-st-leagues button {
    border: 0;
    background: none;
    font: inherit;
    cursor: pointer;
}

.hm-st-sports button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding-bottom: 8px;
    color: var(--color-muted);
    font-size: 11px;
}

.hm-st-sports svg {
    width: 22px;
    height: 22px;
}

.hm-st-sports button.active {
    color: var(--color-primary-dark);
    font-weight: 700;
    box-shadow: inset 0 -2px var(--color-primary);
}

.hm-st-leagues {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    padding: 8px 10px;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    font-size: 12px;
}
@media (max-width: 1023px) {
    .hm-st-leagues {
        scrollbar-width: none;
    }
}
.hm-st-leagues::-webkit-scrollbar {
    width: 2px;
    height: 2px;
}
.hm-st-leagues::-webkit-scrollbar-track {
    background: transparent;
}
.hm-st-leagues::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #cdd2da;
}
.hm-st-leagues::-webkit-scrollbar-thumb:hover {
    background: #aeb4be;
}
:root[data-theme="dark"] .hm-st-leagues::-webkit-scrollbar-thumb {
    background: #4a4f57;
}
:root[data-theme="dark"] .hm-st-leagues::-webkit-scrollbar-thumb:hover {
    background: #646a73;
}

.hm-st-leagues button {
    flex: none;
    padding: 3px 8px;
    border-radius: 999px;
    color: var(--color-muted);
}

.hm-st-leagues button.active {
    background: var(--color-primary-soft);
    color: var(--color-primary-dark);
    font-weight: 700;
}

.hm-st-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.hm-st-table th,
.hm-st-table td {
    height: 30px;
    padding: 0 4px;
    border-bottom: 1px solid var(--color-line-soft);
    text-align: center;
}

.hm-st-table th {
    color: var(--color-muted);
    font-weight: 400;
}

.hm-st-table td:first-child {
    width: 34px;
    color: var(--color-primary-dark);
    font-weight: 700;
}

.hm-st-table .left {
    text-align: left;
    white-space: nowrap;
}

.hm-st-table td.left {
    white-space: normal;
    overflow-wrap: anywhere;
}

.hm-st-table td.left img {
    float: left;
    width: 16px;
    height: 16px;
    margin-right: 6px;
    object-fit: contain;
    vertical-align: -4px;
}

.hm-st-table .pt {
    font-weight: 700;
}

.hm-st-table tbody tr:last-child td {
    border-bottom: 0;
}

@media (max-width: 1023px) {
    .hm-notice li + li {
        display: none;
    }

    .hm .box-head {
        flex-wrap: wrap;
        gap: 6px;
        height: auto;
        min-height: 50px;
        padding: 10px 14px;
    }

    .hm-sports {
        padding: 12px 4px 0;
    }

    .hm-sports svg {
        width: 26px;
        height: 26px;
    }

    .hm-sports span {
        font-size: 11px;
    }

    .hm-sports em {
        left: calc(50% + 8px);
        padding: 0 4px;
        font-size: 10px;
    }

    /* 글꼴이 늦게 바뀌며 줄이 접혔다 펴지면 아래가 밀려서, 줄바꿈은 글꼴이 아니라 화면 폭으로 정함 */
    .hm-filter {
        gap: 8px 14px;
        margin: 10px 12px 0;
    }

    .hm-filter button {
        flex: none;
        white-space: nowrap;
        position: relative;
    }

    .hm-filter button::after {
        content: "";
        position: absolute;
        inset: -8px 0;
    }

    .hm-filter select {
        min-width: 0;
    }

    @media (max-width: 399px) {
        .hm-filter {
            flex-wrap: wrap;
        }

        .hm-filter select {
            flex-basis: 100%;
            margin-left: 0;
        }
    }

    .hm-feature {
        padding: 12px;
    }

    .hm-team {
        flex: 1;
        overflow: hidden;
        font-size: 13px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .hm-score {
        font-size: 24px;
    }

    .hm-col-prog {
        display: none;
    }

    .hm-games th:nth-child(1) {
        width: 62px;
    }

    .hm-games th:nth-child(2) {
        width: 44px;
    }

    /* 좁은 화면은 날짜를 시각 위 줄로 */
    .hm-day {
        display: block;
    }

    .hm-games th:nth-child(5) {
        width: 68px;
    }

    .hm-badge {
        margin: 0 3px;
    }

    .hm-lg {
        width: 54px;
        font-size: 10px;
    }

    .hm-table th,
    .hm-table td {
        padding: 0 3px;
        font-size: 12px;
    }

    .hm-tabs button {
        min-height: 32px;
        padding: 4px 8px;
        font-size: 12px;
    }

    .hm-results th:nth-child(1) {
        width: 44px;
    }

    .hm-results th:nth-child(2) {
        width: 78px;
    }

    .hm-results th:nth-child(4) {
        width: 62px;
    }

    .hm-results .hm-ic {
        display: none;
    }


    .hm-place-name {
        display: none;
    }

    .hm-posts li {
        gap: 8px;
        padding: 0 14px;
    }

    .hm-posts time {
        display: none;
    }

    .hm-coupon {
        flex-wrap: wrap;
        gap: 12px 16px;
        padding: 16px;
    }

    .hm-coupon-point {
        padding-left: 0;
        border-left: 0;
    }

    .hm-coupon-point strong {
        font-size: 24px;
    }

    .hm-coupon-btn {
        flex: 1 0 100%;
        text-align: center;
    }
}

.notice-label {
    color: var(--color-primary-dark);
    font-weight: 700;
}

.chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    height: 56px;
    padding: 0 16px;
    border-bottom: 1px solid var(--color-border);
}

.chat-head .chat-title {
    display: inline-flex;
    flex: none;
    align-items: center;
}

/* .chat-btn--ghost보다 앞에 있어서 우선순위를 올림 */
.chat-head .chat-menu-btn {
    height: 30px;
    margin-left: -8px;
    padding: 0 8px;
    color: var(--color-text);
    font-size: 16px;
    font-weight: 700;
}

.chat-head .chat-menu-btn.active {
    background: transparent;
}

.chat-tabs {
    position: relative;
    min-width: 0;
    border-radius: var(--chat-radius-pill);
    background: var(--chat-fill);
}

/* 흐림만으론 옆에 방이 더 있는 걸 알아채기 어려워 화살표를 겹쳐 둠 */
.chat-tabs-arrow {
    position: absolute;
    top: 50%;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--color-surface);
    box-shadow: 0 1px 3px rgba(17, 24, 39, 0.18);
    color: var(--color-text);
    cursor: pointer;
    transform: translateY(-50%);
}

.chat-tabs-arrow--prev {
    left: 3px;
}

.chat-tabs-arrow--next {
    right: 3px;
}

/* 공식 방이 많으면 넘치는 탭은 잘리고 목록 화면에서 고름 */
.chat-tabs-scroll {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 3px;
}

.chat-tabs-scroll::-webkit-scrollbar {
    display: none;
}

.chat-tabs-scroll.fade-start,
.vr-tabs.fade-start {
    mask-image: linear-gradient(to right, transparent, #000 24px);
}

.chat-tabs-scroll.fade-end,
.vr-tabs.fade-end {
    mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
}

.chat-tabs-scroll.fade-start.fade-end,
.vr-tabs.fade-start.fade-end {
    mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}

.chat-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 30px;
    padding: 0 12px;
    border-radius: var(--chat-radius-pill);
    color: var(--chat-text-soft);
    font-size: 12px;
    white-space: nowrap;
    transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.chat-tabs a:hover {
    color: var(--color-text);
    text-decoration: none;
}

.chat-tabs a:focus-visible {
    outline: none;
    box-shadow: var(--chat-focus-ring);
}

.chat-tabs a.active {
    background: var(--color-surface);
    color: var(--color-text);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.1), 0 0 0 1px rgba(17, 24, 39, 0.03);
    border: solid 1px var(--color-primary);
}

.chat-tabs em {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: var(--color-text);
    font-size: 11px;
    font-style: normal;
    font-weight: 400;
}
.chat-tabs em .count {
    font-weight: bold;
    color: var(--color-count);
}

.chat-list {
    height: 452px;
    padding: 8px 10px;
    overflow-y: auto;
    line-height: 1.6;
}

.chat-input {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-top: 1px solid var(--color-border);
}

.chat-input--guest {
    padding-top: 5px;
    padding-bottom: 5px;
}

.post-cat {
    flex: none;
    color: var(--color-muted);
}

.post-cat.accent {
    width: 56px;
    color: var(--color-primary-dark);
}

.sports-tabs a,
.vr-tabs__tab {
    padding: 10px 12px;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--color-muted);
    white-space: nowrap;
    flex: 1;
    display: flex;
    justify-content: center;
}

.sports-tabs a:hover,
.vr-tabs__tab:hover {
    color: var(--color-text);
    text-decoration: none;
}

.sports-tabs a.active,
.vr-tabs__tab.is-active {
    background: var(--color-fill);
    color: var(--color-text);
    font-weight: 700;
}

/* 회색 페이지 바탕 위 탭은 연회색이 묻혀서 흰 알약으로 */
.sports-tabs a.active,
.vr-tabs__tab.is-active {
    background: var(--color-surface);
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.08);
    border: solid 1px var(--color-primary);
}

.site-footer {
    padding: 32px 0 40px;
    background: var(--color-footer);
    color: #9f9f9f;
    font-size: 12px;
}

/* 라이브스코어가 그려지기 전엔 푸터를 숨기되 스크립트가 실패해도 3초 뒤엔 보이게 */
body:has(#sports-games:empty) .site-footer {
    visibility: hidden;
    animation: footer-reveal 0s 3s forwards;
}

body:has(#virtual-races:empty) .site-footer,
body:has(#virtual-races .vr-venue > .vr-video:only-child) .site-footer {
    visibility: hidden;
    animation: footer-reveal 0s 3s forwards;
}

@keyframes footer-reveal {
    to { visibility: visible; }
}

.site-footer strong {
    color: #ffffff;
}

.footer-logo img {
    display: block;
    width: auto;
    height: 36px;
    margin-bottom: 16px;
}

.footer-links strong {
    height: 36px;
    display: flex;
    align-items: center;
    font-size: 14px;
    text-decoration: underline;
    text-underline-offset: 4px;
}
.footer-links a {
    color: #cfcfcf;
    height: 24px;
    display: flex;
    align-items: center;
    align-self: center;
    margin-left: 4px;
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    gap: 40px;
}

.footer-grid p {
    margin: 8px 0 0;
}

.footer-links {
    display: flex;
    gap: 48px;
}

.footer-links div {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.copyright {
    margin-top: 24px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
}
.btn.h40 {
    height: 40px;
}

.btn:hover {
    text-decoration: none;
    background: var(--color-fill);
}

.btn-primary {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
}

.btn-danger {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.page {
    padding: 24px 0 48px;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-left: 8px;
    box-sizing: border-box;
}

.page-head h1 {
    margin: 0;
    font-size: 24px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    color: var(--color-muted);
    font-size: 12px;
}

.breadcrumb a {
    color: inherit;
}

.breadcrumb > * + *::before {
    content: "›";
    margin-right: 6px;
}

.breadcrumb [aria-current] {
    color: var(--color-text);
}

.crumb-menu {
    position: relative;
    display: inline-block;
}

.crumb-menu summary {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    list-style: none;
    -webkit-tap-highlight-color: transparent;
}

.crumb-menu summary::-webkit-details-marker {
    display: none;
}

.crumb-menu summary::after {
    content: "";
    width: 5px;
    height: 5px;
    margin-top: -3px;
    border: solid currentColor;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
    transition: transform .15s;
}

.crumb-menu[open] summary::after {
    margin-top: 3px;
    transform: rotate(-135deg);
}

.crumb-menu summary:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

.crumb-menu-list {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    min-width: 140px;
    max-width: calc(100vw - 32px);
    max-height: 60vh;
    padding: 4px;
    overflow-y: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
    font-size: 13px;
}

.breadcrumb .crumb-menu-list a {
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--color-text);
    white-space: nowrap;
}

.crumb-menu-list a:hover {
    background: var(--color-fill);
}

.breadcrumb .crumb-menu-list a[aria-current] {
    color: var(--color-primary-dark);
    font-weight: 700;
    background: var(--color-primary-soft);
}

.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    padding: 12px;
    align-items: center;
}

.search-bar select,
.search-bar input,
.post-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.post-form select,
.post-form textarea,
.comment-form textarea,
.report-dialog textarea,
.message-report select,
.message-report textarea,
.vr-replay__search select,
.vr-replay__search input {
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
}

.post-form textarea,
.comment-form textarea,
.report-dialog textarea,
.message-report textarea {
    height: auto;
    padding: 10px 12px;
}

.search-bar select:focus,
.search-bar input:focus,
.post-form input:focus,
.post-form select:focus,
.post-form textarea:focus,
.comment-form textarea:focus,
.report-dialog textarea:focus,
.message-report select:focus,
.message-report textarea:focus,
.vr-replay__search select:focus,
.vr-replay__search input:focus,
.post-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus {
    outline: none;
    border-color: var(--color-primary-dark);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.search-bar input {
    flex: 1;
}

.view-toggle {
    display: flex;
    align-self: center;
    margin-left: 8px;
    padding: 3px;
    border-radius: 999px;
    background: var(--color-fill);
}

.view-toggle a {
    min-width: 56px;
    padding: 6px 13px;
    border-radius: 999px;
    color: var(--color-muted);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    display: flex;
    justify-content: center;
    align-items: center;
}

.view-toggle a:hover {
    color: var(--color-text);
    text-decoration: none;
}

.view-toggle a.active {
    background: var(--color-surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    color: var(--color-text);
    border: solid 1px var(--color-primary);
}

.board-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.board-table th,
.board-table td {
    height: 44px;
    padding: 0 12px;
    border-bottom: 1px solid var(--color-line-soft);
    text-align: center;
    white-space: nowrap;
}

.board-table th {
    background: var(--color-head-bg);
    color: var(--color-muted);
    font-weight: 600;
}

.board-table .title {
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
}

.board-table .col-no { width: 80px; }
.board-table .col-author { width: 120px; }
.board-table .col-view { width: 70px; }
/* 많이 본 글 조회수 눈에 띄게 */
.board-table .col-view.view-hot,
.gallery-meta .view-hot { color: var(--color-gold); }
.board-table .col-view.view-hot--top,
.gallery-meta .view-hot--top { color: var(--color-accent); }
.view-hot--bold,
.view-hot--top { font-weight: 700; }
.board-table .col-date { width: 110px; color: var(--color-muted); }
.message-table .col-date { width: 140px; white-space: nowrap; }

.board-table .empty,
.board-empty,
.coupon-empty,
.gallery-empty,
.vr-replay__status {
    padding: 56px 16px;
    color: var(--color-muted);
    font-size: 13px;
    text-align: center;
}

.board-table td.empty {
    height: auto;
    white-space: normal;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 16px;
}

.gallery-card {
    min-width: 0;
}

.gallery-card a {
    display: block;
}

.gallery-card a:hover {
    text-decoration: none;
}

.gallery-card a:hover .gallery-title {
    text-decoration: underline;
}

.gallery-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #eceef2;
}

.gallery-thumb--empty {
    position: relative;
}

/* 이미지 없는 글은 로고를 흐리게 */
.gallery-thumb--empty::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("/img/logo-6c4ba53b4aaf8503228a83055198a706.webp") center / 50% auto no-repeat;
    filter: grayscale(1);
    opacity: 0.35;
}

.gallery-title {
    display: block;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.gallery-card .activity-title {
    align-items: baseline;
}

.gallery-meta {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    color: var(--color-muted);
    font-size: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.gallery-author {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}
.gallery-author .name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-empty {
    margin: 0;
}

.board-desc {
    margin: 6px 0 0;
    color: var(--color-muted);
}

.write-limit {
    color: var(--color-muted);
}

.board-empty p {
    margin: 0 0 16px;
}

.link-copy-status {
    align-self: center;
    color: var(--color-muted);
    font-size: 13px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 16px;
}

.pagination a {
    min-width: 32px;
    padding: 6px 10px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    text-align: center;
}

.pagination a.active {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
}

.pagination .page-mobile {
    display: none;
}

.post-detail header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
}

.post-detail h1 {
    margin: 8px 0;
    font-size: 20px;
}

.post-detail .meta {
    display: flex;
    gap: 16px;
    color: var(--color-muted);
}

.post-detail .post-author {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.post-detail .content {
    min-height: 240px;
    padding: 24px;
    line-height: 1.8;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.post-detail .content--html > :first-child,
.post-editor__body .ProseMirror > :first-child {
    margin-top: 0;
}

.content--html :is(p, ul, ol, blockquote, h2, h3),
.post-editor__body .ProseMirror :is(p, ul, ol, blockquote, h2, h3) {
    margin: 0 0 8px;
}

/* 빈 줄도 한 줄 높이를 차지하게 */
.content--html p:empty::after {
    content: "\00a0";
}

.content--html h2,
.post-editor__body .ProseMirror h2 {
    margin-top: 20px;
    font-size: 20px;
}

.content--html h3,
.post-editor__body .ProseMirror h3 {
    margin-top: 16px;
    font-size: 17px;
}

.content--html :is(ul, ol),
.post-editor__body .ProseMirror :is(ul, ol) {
    padding-left: 24px;
}

.content--html ul,
.post-editor__body .ProseMirror ul {
    list-style: disc;
}

.content--html ol,
.post-editor__body .ProseMirror ol {
    list-style: decimal;
}

.content--html :is(li, blockquote) > p,
.post-editor__body .ProseMirror :is(li, blockquote) > p {
    margin: 0;
}

.content--html blockquote,
.post-editor__body .ProseMirror blockquote {
    padding: 8px 14px;
    border-left: 3px solid var(--color-primary);
    background: var(--color-fill);
}

.content--html a,
.post-editor__body .ProseMirror a {
    color: var(--color-blue);
    text-decoration: underline;
}

.content--html :is(img, video),
.post-editor__body .ProseMirror :is(img, video) {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 8px 0;
}

.content--html video,
.post-editor__body .ProseMirror video {
    width: 100%;
    max-height: 80vh;
    background: #000;
}

/* 브라우저 기본 검정 대신 감싼 글자색을 따름 */
.content--html mark {
    color: inherit;
}

.post-editor {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
}

.post-editor:focus-within {
    border-color: var(--color-primary-dark);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}

/* 모바일은 한 줄로 두고 옆으로 밀어 봄 */
.post-editor__bar {
    display: flex;
    gap: 2px;
    padding: 6px;
    overflow-x: auto;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-fill);
    border-radius: 8px 8px 0 0;
    scrollbar-width: thin;
}

.post-editor__bar button {
    flex: none;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--color-text);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}

.post-editor__bar button:hover {
    background: var(--color-fill-strong);
}

.post-editor__bar button.is-active {
    border-color: var(--color-primary-outline);
    background: var(--color-primary-soft);
    color: var(--color-primary-dark);
}

.post-editor__bar button:disabled {
    opacity: 0.4;
    cursor: default;
}

.post-editor__bar .post-editor__pick {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    line-height: 1;
}

.post-editor__line {
    width: 16px;
    height: 3px;
    border-radius: 1px;
    background: var(--color-text);
}

.post-editor__line.is-empty {
    background: transparent;
    box-shadow: inset 0 0 0 1px var(--color-muted);
}

.post-editor__sep {
    flex: none;
    width: 1px;
    margin: 6px 4px;
    background: var(--color-border);
}

.post-editor__colors {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    border-bottom: 1px solid var(--color-border);
}

.post-editor__colors button {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    cursor: pointer;
}

.post-editor__colors button.is-clear {
    width: auto;
    padding: 0 10px;
    border-radius: 13px;
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    font-size: 12px;
}

.post-editor__body .ProseMirror {
    min-height: 320px;
    padding: 12px 14px;
    line-height: 1.8;
    outline: none;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.post-editor__body .ProseMirror .ProseMirror-selectednode {
    outline: 3px solid var(--color-primary-dark);
}

.post-editor__error {
    margin: 0;
    padding: 0 14px 10px;
    color: var(--color-accent);
    font-size: 12px;
    white-space: pre-line;
}

.inquiry-table tbody tr {
    position: relative;
}

/* 제목 링크를 줄 전체로 넓혀 어디를 눌러도 열림 */
.inquiry-table td.title a::after {
    content: "";
    position: absolute;
    inset: 0;
}

.inquiry-table tbody tr:hover td {
    background: var(--color-head-bg);
}

.inquiry-answer {
    margin-top: 16px;
}

.inquiry-answer h2 {
    margin: 0 0 8px;
    font-size: 17px;
}

.inquiry-answer .content {
    min-height: 0;
}

.post-detail .post-images-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px 24px 0;
}

.post-detail .post-images-view a {
    align-self: center;
    max-width: min(100%, calc(80vh * var(--ratio, 100)));
}

.post-detail .post-images-view img {
    display: block;
    max-width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
}

.post-detail .post-images-view video {
    display: block;
    width: 100%;
    height: auto;
    max-height: 80vh;
    background: #000;
}

.post-embed {
    margin: 8px 0;
    white-space: normal;
}

.post-embed iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
}

.post-embed--tall iframe {
    width: auto;
    height: min(70vh, 640px);
    max-width: 100%;
    aspect-ratio: 9 / 16;
    margin: 0 auto;
}

/* 글 길이에 따라 높이가 달라져 넉넉히 잡음 */
.post-embed--tweet iframe,
.post-embed--insta iframe {
    max-width: 550px;
    height: 480px;
    aspect-ratio: auto;
    margin: 0 auto;
}

/* 웹툰·캡처처럼 긴 이미지는 화면 높이에 맞추면 글씨가 안 보여서 원래 폭으로 */
.post-detail .post-images-view a.is-long {
    max-width: 100%;
}

.post-detail .post-images-view a.is-long img {
    max-height: none;
}

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.actions form {
    margin: 0;
}

.post-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
}

.post-form label,
.post-form .form-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.post-form label > span,
.post-form .form-content > span {
    font-weight: 700;
}

.post-form label[hidden] {
    display: none;
}

.post-form .error {
    color: var(--color-accent);
    font-size: 12px;
    font-style: normal;
}

.post-form .form-board {
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-form .form-board > span {
    font-weight: 700;
}

.phone-verify .phone-code {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
}

.phone-verify .phone-code input {
    flex: 1;
    min-width: 0;
}

/* invisible reCAPTCHA 칸이 폼 gap을 한 번 더 먹지 않게 */
.phone-verify [data-recaptcha] {
    position: absolute;
}

.phone-verify [data-message] a {
    color: inherit;
    text-decoration: underline;
}

.phone-current {
    margin: 0;
    padding: 24px 24px 0;
}

.phone-ready {
    margin: 0;
    padding: 8px 24px 24px;
    color: var(--color-muted);
}

.btn:disabled,
.btn[disabled] {
    border-color: var(--color-border);
    background: var(--color-fill);
    color: var(--color-scheduled);
    cursor: not-allowed;
}

.not-found {
    text-align: center;
}

.not-found h1 {
    font-size: 24px;
    margin: 40px 0 8px;
}

.chat-status {
    position: relative;
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-left: 6px;
    border-radius: 50%;
    background: var(--color-scheduled);
}

.chat-popup-btn {
    align-self: center;
    margin-left: 4px;
}

.chat-handoff {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--chat-text-soft);
}

.chat-handoff p {
    margin: 0;
}

.chat-popup-page {
    min-width: 0;
}

.chat--popup {
    display: flex;
    flex-direction: column;
    height: 100vh;
    border: 0;
    border-radius: 0;
}

.chat--popup .chat-list,
.chat--popup .chat-panel {
    flex: 1;
    height: auto;
    min-height: 0;
}

.chat-status.online {
    background: var(--color-primary);
}

.chat-total {
    margin-left: 6px;
    font-size: 13px;
    font-style: normal;
    white-space: nowrap;
    opacity: 0.7;
}
.chat-total .count {
    font-weight: bold;
    color: var(--color-count);
}

.chat-status.online::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--color-primary);
    animation: chat-pulse 2.4s ease-out infinite;
}

@keyframes chat-pulse {
    0% {
        opacity: 0.45;
        transform: scale(1);
    }
    70%,
    100% {
        opacity: 0;
        transform: scale(2.6);
    }
}

@media (prefers-reduced-motion: reduce) {
    .chat-status.online::after {
        animation: none;
        opacity: 0;
    }
}

.chat-list li {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 2px 6px;
    border-radius: var(--chat-radius-sm);
    transition: background-color 0.15s;
    margin-bottom: 3px;
    border: solid 1px #00000000;
}

.chat-list li:where(:not(.chat-empty):not(.chat-randombox-row):not(.chat-room-event):not(.chat-admin-notice)):hover {
    background: var(--color-head-bg);
    border: solid 1px var(--vr-freeze-line);
}

.chat-list li.mine {
    background: var(--chat-primary-soft);
    border: solid 1px var(--color-primary-outline);
    box-shadow: 2px 2px 0 0 #00000010;
}

/* 내용은 닉네임 뒤에 이어 쓰고, 계급장을 왼쪽 기둥으로 빼서 줄 경계가 보이게 */
.chat-list li:not(.chat-randombox-row):not(.chat-empty) {
    display: block;
    position: relative;
    padding: 5px 48px 5px 30px;
    line-height: 1.5;
}

.chat-list li:not(.chat-randombox-row):not(.chat-empty) + li {
    margin-top: 2px;
}

.chat-list li:not(.chat-randombox-row):not(.chat-empty) > :not(.chat-msg-time):not(:last-child) {
    margin-right: 5px;
}

.chat-list li:not(.chat-randombox-row):not(.chat-empty) :is(.chat-rank-icon, .chat-rank, .chat-admin-icon) {
    position: absolute;
    top: 8px;
    left: 6px;
    margin: 0;
}

.chat-list li:not(.chat-randombox-row):not(.chat-empty):not(.mine):not(.chat-admin-notice) .chat-msg-nick {
    color: var(--color-primary-dark);
}

.chat-list li:not(.chat-randombox-row):not(.chat-empty) .chat-msg-text:not(.chat-bubble):not(.chat-hidden) {
    color: var(--color-text);
}

.chat-list li:not(.chat-randombox-row):not(.chat-empty) .chat-msg-time {
    position: absolute;
    top: 6px;
    right: 6px;
    color: var(--color-text);
}

/* 줄마다 따로 그리지 않고 메시지 전체를 말풍선 하나로 */
.chat-list li:not(.chat-randombox-row):not(.chat-empty) .chat-bubble {
    display: inline-block;
    max-width: 100%;
    padding: 6px 10px 4px;
    vertical-align: top;
    margin-bottom: 2px;
    border-radius: 16px;
}

.chat-msg-nick {
    flex: none;
    font-weight: 600;
}

.chat-list li.mine .chat-msg-nick {
    color: var(--color-primary-dark);
}

.chat-msg-text {
    flex: 1;
    min-width: 0;
    color: var(--color-text);
    word-break: break-all;
}

.chat-bubble {
    padding: 0 7px;
    border-radius: 10px;
}

.chat-msg-text.chat-bubble {
    flex: 0 1 auto;
    margin-right: auto;
}

.chat-bubble--sky {
    background: #d9eefc;
    box-shadow: inset 0 0 0 1px #5aa9e0;
    color: #0a4a7a;
}

.chat-list li.mine .chat-bubble--sky,
.chat-bubble-option[aria-pressed="true"] .chat-bubble--sky {
    background: #c5e4fa;
}

.chat-bubble--pink {
    background: #fde3ee;
    box-shadow: inset 0 0 0 1px #e48bb1;
    color: #8c1a4b;
}

.chat-bubble--army {
    background: #5b6b3a;
    box-shadow: inset 0 0 0 1px #27301a;
    color: #f4f1e0;
}

.chat-bubble--bronze {
    background: linear-gradient(#f6e3cc, #e9c9a3);
    box-shadow: inset 0 0 0 1px #a8692f;
    color: #5a3410;
}

.chat-bubble--silver {
    background: linear-gradient(#ffffff, #dde2e7);
    box-shadow: inset 0 0 0 1px #8c96a1;
    color: #2f3842;
}

.chat-bubble--gold {
    background: linear-gradient(#fff3c4, #ffe27a);
    box-shadow: inset 0 0 0 1px #d49a1c;
    color: #5c3f05;
}

.chat-bubble--star {
    background: #1b2440;
    box-shadow: inset 0 0 0 1px #d49a1c;
    color: #ffe27a;
}

@property --fx-a {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

.chat-fx {
    position: relative;
    isolation: isolate;
}

.chat-bubble--star.chat-fx {
    box-shadow: inset 0 0 0 1px #d49a1c, 0 0 7px rgba(255, 200, 70, 0.5);
}

.chat-bubble--star.chat-fx-ring::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1.5px;
    border-radius: inherit;
    background: conic-gradient(from var(--fx-a), transparent 0 60%, #ffc53d 80%, #fffbe6 92%, transparent 99%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    animation: fx-ring 3s linear infinite;
    animation-delay: var(--fx-delay, 0s);
}

@keyframes fx-ring {
    to { --fx-a: 360deg; }
}

.chat-bubble--star.chat-fx::after {
    --fx-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 0C5.4 3.3 6.7 4.6 10 5C6.7 5.4 5.4 6.7 5 10C4.6 6.7 3.3 5.4 0 5C3.3 4.6 4.6 3.3 5 0Z' fill='%23ffc21a' stroke='%23a86f00' stroke-width='.5'/%3E%3C/svg%3E");
    content: "";
    position: absolute;
    inset: -5px -4px;
    background:
        var(--fx-star) right top / 10px no-repeat,
        var(--fx-star) left bottom / 8px no-repeat;
    pointer-events: none;
    animation: fx-glint 2.4s ease-in-out infinite;
    animation-delay: var(--fx-delay, 0s);
}

@keyframes fx-glint {
    0%, 100% { opacity: 0.25; }
    50% { opacity: 1; }
}

/* 잘라 내지 않고 양 끝에서 흐려지게 해서 금의 빛 번짐과 같이 씀 */
.chat-fx:is(.chat-bubble--bronze, .chat-bubble--silver, .chat-bubble--gold)::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(110deg, transparent 36%, var(--fx-shine, rgba(255, 255, 255, 0.9)) 50%, transparent 64%);
    opacity: 0;
    pointer-events: none;
    animation: fx-sweep var(--fx-sweep-time, 4s) ease-in-out infinite;
    animation-delay: var(--fx-delay, 0s);
}

.chat-bubble--bronze.chat-fx {
    --fx-shine: rgba(255, 255, 255, 0.5);
    --fx-sweep-time: 9s;
}

@keyframes fx-sweep {
    0%, 60% { opacity: 0; transform: translateX(-40%); }
    70%, 88% { opacity: 1; }
    100% { opacity: 0; transform: translateX(40%); }
}

.chat-bubble--gold.chat-fx::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    box-shadow: 0 0 8px 1px rgba(255, 184, 0, 0.75);
    opacity: 0.6;
    pointer-events: none;
    animation: fx-breathe 2.6s ease-in-out infinite alternate;
    animation-delay: var(--fx-delay, 0s);
}

@keyframes fx-breathe {
    from { opacity: 0.2; }
    to { opacity: 1; }
}

/* 기본값이 멈춘 모양이라 애니메이션만 끔 */
@media (prefers-reduced-motion: reduce) {
    .chat-fx::before,
    .chat-fx::after {
        animation: none !important;
    }
}

.chat-msg-time {
    flex: none;
    color: var(--color-text);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.chat-list .chat-empty {
    justify-content: center;
    padding: 16px 0;
    color: var(--color-muted);
}

/* 위로 올려 읽는 동안 목록 아래에 떠 있게, 줄 전체가 글 클릭을 막지 않게 */
.chat-list .chat-newer {
    position: sticky;
    bottom: 0;
    padding: 4px 0;
    pointer-events: none;
}

.chat-list .chat-newer .chat-btn {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    pointer-events: auto;
}

.chat-error {
    margin: 0;
    padding: 6px 16px;
    color: var(--color-accent);
    font-size: 12px;
}

.chat > .chat-notice,
.chat > .chat-error {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat > .chat-notice {
    background: var(--chat-primary-soft);
}

.chat > .chat-error {
    background: var(--chat-danger-soft);
    color: var(--color-error);
}

.chat > .chat-notice .chat-icon,
.chat > .chat-error .chat-icon {
    flex: none;
}

.chat-list .chat-rank-icon {
    flex: none;
    width: auto;
    height: 20px;
    /* 기준선 정렬에서 아이콘이 위로 튀어나와 줄이 커지지 않게 */
    margin-top: -1px;
}

.chat-list .chat-rank {
    flex: none;
    padding: 0 6px;
    border-radius: var(--chat-radius-pill);
    background: var(--chat-primary-soft);
    color: var(--color-primary-dark);
    font-size: 11px;
    font-style: normal;
    font-weight: 600;
    line-height: 17px;
}

/* 같은 연한 배경 위에서 칩이 묻히지 않게 */
.chat-list li.mine .chat-rank,
.chat-list li.chat-admin-notice .chat-rank {
    background: var(--color-surface);
}

.chat-login {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    border-radius: var(--chat-radius-pill);
    background: var(--chat-primary-soft);
    color: var(--color-primary-dark);
    font-size: 12px;
    font-weight: 600;
    transition: background-color 0.15s;
}

.chat-login:hover {
    background: #d6f5e1;
    text-decoration: none;
}

.chat-login:focus-visible {
    outline: none;
    box-shadow: var(--chat-focus-ring);
}

.chat-panel {
    height: 452px;
    padding: 12px 16px;
    overflow-y: auto;
}

.chat-list--room {
    height: 420px;
}

.chat-room-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 10px 0 8px;
    border-bottom: 1px solid var(--color-border);
    font-size: 12px;
}

.chat-room-bar .chat-room-back {
    padding: 0 8px 0 4px;
}

.chat-room-bar .chat-room-back:hover {
    text-decoration: none;
}

.chat-room-bar strong {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-room-bar .chat-room-lock {
    align-self: center;
    margin-left: 4px;
    color: var(--color-muted);
    vertical-align: -1px;
}

.chat-room-bar em {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 3px;
    color: var(--color-muted);
    font-size: 11px;
    font-style: normal;
}

.chat-room-search {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.chat-search-field {
    position: relative;
    display: flex;
    flex: 1;
    min-width: 0;
}

.chat-search-submit {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    padding: 0 6px 0 9px;
    border: 0;
    background: none;
    color: var(--color-muted);
    cursor: pointer;
}

.chat .chat-search-field input[type="search"] {
    flex: 1;
    width: 100%;
    min-width: 0;
    padding-left: 28px;
}

.chat-room-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.chat-room-item {
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--chat-radius);
    cursor: pointer;
    transition: background-color 0.15s;
}

.chat-room-item--official {
    background: var(--color-fill-soft);
}
@media (max-width: 1023px) and (orientation: landscape) and (max-height: 500px) {
    .chat-dock .chat-room-item--official {
        background: rgba(255, 255, 255, 0.06);
    }
    .chat-dock .chat-room-item {
        border: 1px solid rgba(255, 255, 255, 0.12);
    }
    .chat-dock .chat-room-count {
        color: rgba(255, 255, 255, 0.9) !important;
    }

    .chat-dock .chat-room-lock,
    .chat-dock .chat-room-sub,
    .chat-dock .chat-profile-note {
        color: rgba(255, 255, 255, 0.75);
    }
}

.chat-room-item:hover {
    background: var(--chat-fill);
}

@media (max-width: 1023px) {
    .chat-dock .chat-room-item:hover {
        background: transparent;
    }
}

.chat-room-list .chat-empty {
    padding: 16px 0;
    color: var(--color-muted);
    font-size: 12px;
    text-align: center;
}

.chat-btn.chat-more {
    display: flex;
    width: 100%;
    margin-top: 8px;
}

.chat-room-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: inherit;
    text-decoration: none;
}

.chat-room-link:focus-visible {
    border-radius: var(--chat-radius-sm);
    outline: none;
    box-shadow: var(--chat-focus-ring);
}

.chat-room-name {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
}

.chat-room-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-room-official {
    flex: none;
    padding: 2px 6px;
    border-radius: var(--chat-radius-pill);
    background: var(--chat-primary-soft);
    color: var(--color-primary-dark);
    font-size: 10px;
    font-weight: 600;
}

.chat-room-lock {
    display: inline-flex;
    flex: none;
    color: var(--color-muted);
}

.chat-room-count {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 3px;
    color: var(--color-muted);
    font-size: 11px;
}

.chat-room-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    color: var(--color-muted);
    font-size: 11px;
}

.chat-tag {
    height: 20px;
    padding: 0 8px;
    border: 0;
    border-radius: var(--chat-radius-pill);
    background: var(--chat-primary-soft);
    color: var(--color-primary-dark);
    font-family: inherit;
    font-size: 11px;
    line-height: 20px;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.chat-tag:hover {
    background: var(--color-primary);
    color: #fff;
}

.chat-tag:focus-visible {
    outline: none;
    box-shadow: var(--chat-focus-ring);
}

.chat-btn,
.chat-icon-btn,
.chat-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 0;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.chat-btn {
    height: 28px;
    padding: 0 10px;
    border-radius: var(--chat-radius-sm);
    background: var(--chat-fill);
    color: var(--color-text);
    font-size: 12px;
}

.chat-btn:hover:not(:disabled) {
    background: var(--chat-hover);
}

.chat-btn--sm {
    height: 24px;
    padding: 0 8px;
    font-size: 11px;
}

.chat-btn--primary {
    background: var(--color-primary);
    color: #fff;
}

.chat-btn--primary:hover:not(:disabled) {
    background: var(--chat-primary-hover);
}

.chat-btn--danger {
    background: transparent;
    color: var(--color-accent);
}

.chat-btn--danger:hover:not(:disabled) {
    background: var(--chat-danger-soft);
    color: var(--color-error);
}

.chat-btn--ghost {
    background: transparent;
    color: var(--chat-text-soft);
}

.chat-menu button.is-danger:hover:not(:disabled),
.chat-menu button.is-danger:hover:not(:disabled) .chat-icon {
    color: var(--color-error);
}

.chat-btn--ghost:hover:not(:disabled) {
    background: transparent;
    color: var(--color-text);
}

.chat-icon-btn {
    flex: none;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--chat-text-soft);
}

.chat-icon-btn:hover:not(:disabled) {
    background: var(--chat-fill);
    color: var(--color-text);
}

.chat-icon-btn--sm {
    width: 24px;
    height: 24px;
}

.chat-icon-btn--primary {
    background: var(--color-primary);
    color: #fff;
}

.chat-icon-btn--primary:hover:not(:disabled) {
    background: var(--chat-primary-hover);
    color: #fff;
}

.chat-btn:focus-visible,
.chat-icon-btn:focus-visible,
.chat-link:focus-visible {
    outline: none;
    box-shadow: var(--chat-focus-ring);
}

.chat-btn:disabled,
.chat-icon-btn:disabled,
.chat-link:disabled {
    opacity: 0.5;
    cursor: default;
}

.chat-link {
    padding: 3px 6px;
    border-radius: var(--chat-radius-sm);
    background: none;
    color: var(--color-primary-dark);
    font-size: 12px;
}

.chat-link:hover:not(:disabled) {
    background: var(--chat-primary-soft);
    text-decoration: none;
}

.chat-link--danger {
    color: var(--color-accent);
}

.chat-link--danger:hover:not(:disabled) {
    background: var(--chat-danger-soft);
}

.chat-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
}

.chat-form-title {
    font-size: 13px;
    font-weight: 600;
}

.chat-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
}

.chat-field-label {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-weight: 600;
}

.chat-form small {
    color: var(--color-muted);
    font-size: 11px;
    font-weight: 400;
}

.chat-form .chat-check {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.chat-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 2px;
}

.chat-form-danger {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 2px;
    padding-top: 10px;
    border-top: 1px solid var(--color-border);
    font-size: 12px;
}

.chat-form-danger span {
    flex: 1 1 100%;
    color: var(--color-accent);
}

.chat-notice {
    margin: 0;
    padding: 6px 16px;
    color: var(--color-primary-dark);
    font-size: 12px;
}

.chat-panel--room {
    height: 420px;
}

.chat-input-bar {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 6px;
    min-width: 0;
    height: 32px;
    padding: 0 2px 0 14px;
    border: 1px solid transparent;
    border-radius: var(--chat-radius-pill);
    background: var(--chat-fill);
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.chat-input-bar:focus-within {
    border-color: var(--color-primary);
    background: var(--color-surface);
    box-shadow: var(--chat-focus-ring);
}

.chat-input-bar .chat-send {
    width: 26px;
    height: 26px;
}

.chat-input-bar .chat-send:disabled {
    background: #c9ced6;
    color: #fff;
    opacity: 1;
}

.chat-input-bar .chat-emoji-btn,
.chat-input-bar .chat-bubble-btn,
.chat-input-bar .chat-randombox-btn {
    width: 26px;
    height: 26px;
}

.chat-input {
    position: relative;
}

.chat-emoji-pop {
    position: absolute;
    right: 12px;
    bottom: calc(100% + 4px);
    z-index: 10;
    max-width: calc(100% - 24px);
    border-radius: var(--chat-radius);
    box-shadow: var(--chat-shadow);
}

.chat-emoji-pop emoji-picker {
    --background: var(--color-surface);
    --border-color: var(--color-border);
    --border-radius: var(--chat-radius);
    --indicator-color: var(--color-primary);
    --input-border-color: var(--color-border);
    --input-border-radius: var(--chat-radius-pill);
    --input-font-color: var(--color-text);
    --input-font-size: 12px;
    --input-padding: 4px 12px;
    --input-placeholder-color: var(--color-muted);
    --outline-color: var(--color-primary);
    --category-font-color: var(--chat-text-soft);
    --category-font-size: 12px;
    --button-active-background: var(--chat-hover);
    --button-hover-background: var(--chat-fill);
    --emoji-padding: 0.3rem;
    max-width: 100%;
    height: 300px;
}

.chat-bubble-pop {
    position: absolute;
    right: 12px;
    bottom: calc(100% + 4px);
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 180px;
    padding: 6px;
    border: 1px solid var(--color-border);
    border-radius: var(--chat-radius);
    background: var(--color-surface);
    box-shadow: var(--chat-shadow);
    line-height: 1.6;
}

.chat-bubble-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 3px 8px;
    border: 1px solid transparent;
    border-radius: var(--chat-radius-sm);
    background: transparent;
    color: var(--color-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.chat-bubble-option:hover:not(:disabled) {
    background: var(--chat-fill);
}

.chat-bubble-option:focus-visible {
    outline: none;
    box-shadow: var(--chat-focus-ring);
}

.chat-bubble-option[aria-pressed="true"],
.chat-bubble-option[aria-pressed="true"]:hover {
    border-color: var(--color-primary);
    background: var(--chat-primary-soft);
}

.chat-bubble-option:disabled {
    cursor: default;
}

/* 계급 안내까지 흐리면 읽기 어려워서 알약만 흐림 */
.chat-bubble-option:disabled .chat-bubble {
    opacity: 0.45;
}

.chat-bubble-option small {
    flex: none;
    color: var(--chat-text-soft);
    font-size: 11px;
}

.chat-input-bar .chat-randombox-btn {
    flex: none;
    border-radius: var(--chat-radius-pill);
    background: var(--color-accent);
    color: #fff;
    font-weight: 600;
}

.chat-input-bar .chat-randombox-btn:hover:not(:disabled) {
    background: #cf2925;
    color: #fff;
}

.chat-input-bar .chat-randombox-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(232, 50, 46, 0.18);
}

/* 카드가 자기 배경을 가져서 내 글·마우스 올림 배경을 깔지 않음 */
.chat-list li.chat-randombox-row,
.chat-list li.chat-randombox-row:hover {
    align-items: center;
    padding-block: 4px;
    background: transparent;
}

.chat-list .chat-randombox {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 0;
    min-width: 0;
    padding: 8px;
    border-radius: var(--chat-radius-sm);
    background: linear-gradient(135deg, #fff7f6, #fff),
    repeating-linear-gradient(45deg, #d42426, #d42426 10px, #ccc 10px, #ccc 20px, #1b4d3e, #1b4d3e 30px, #ccc 30px, #ccc 40px);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    color: var(--color-text, #333840);
    font-family: inherit;
    text-align: left;
    word-break: keep-all;
    overflow-wrap: anywhere;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    border: 3px solid transparent;
}
.chat-randombox .rb {
    margin-top: -8px;
}

.chat-list .chat-randombox:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(232, 50, 46, 0.18);
}

.chat-randombox-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.45;
}

.chat-randombox-text b {
    font-size: 13px;
}
.chat-randombox-text b > span {
    color: var(--color-primary-dark);
    font-size: 13px;
}

.chat-randombox-text span {
    color: var(--chat-text-soft);
    font-size: 12px;
}

.chat-randombox-text strong {
    color: var(--color-accent);
}

.chat-randombox-text em {
    color: var(--color-accent);
    font-size: 11px;
    font-style: normal;
    font-weight: 600;
}

.chat-list .chat-randombox:disabled {
    opacity: 0.5;
    cursor: default;
}

.chat-randombox-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chat-randombox-title .chat-icon {
    color: var(--color-accent);
}

.chat-randombox-balance {
    margin: 0;
    padding: 8px 10px;
    border-radius: var(--chat-radius);
    background: var(--chat-fill);
    color: var(--chat-text-soft);
    font-size: 12px;
}

.chat-randombox-balance b {
    color: var(--color-text);
}

.chat-randombox-result {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-randombox-stage {
    display: flex;
    flex: none;
    flex-direction: column;
    align-items: center;
    padding-top: 8px;
    gap: 4px;
}

.chat-randombox-won {
    position: relative;
    z-index: 1;
    margin-bottom: -6px;
    color: var(--color-accent);
    font-size: 28px;
    line-height: 1.1;
    letter-spacing: -0.5px;
    text-align: center;
}

.chat-randombox-won small {
    display: block;
    font-size: 14px;
}

/* 당첨자가 많아도 닫기가 패널 밖으로 밀리지 않게 목록만 스크롤 */
.chat-randombox-details {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.chat-randombox-result.is-opening .chat-randombox-won {
    opacity: 0;
    animation: chat-giftbox-pop 4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.95s forwards;
}

.chat-randombox-result.is-opening .chat-randombox-details {
    opacity: 0;
    animation: chat-giftbox-fade 0.4s ease-out 1.4s forwards;
}

@keyframes chat-giftbox-pop {
    from { opacity: 0; transform: translateY(40px) scale(0.5); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes chat-giftbox-fade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* 동작 줄이기면 움직임 없이 열린 상태로 */
@media (prefers-reduced-motion: reduce) {
    .chat-randombox-result.is-opening * {
        animation-duration: 0.01ms !important;
        animation-delay: 0s !important;
    }
}

.chat-randombox-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--color-muted);
    font-size: 12px;
}

.chat-randombox-status {
    padding: 0 8px;
    border-radius: var(--chat-radius-pill);
    background: var(--chat-fill);
    color: var(--chat-text-soft);
    font-size: 11px;
    line-height: 20px;
}

.chat-randombox-winners {
    min-height: 0;
    overflow-y: auto;
    margin: 0;
    padding: 0 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--chat-radius);
    font-size: 12px;
    list-style: none;
}

.chat-randombox-winners li {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--color-fill-strong);
}

.chat-randombox-winners li:last-child {
    border-bottom: 0;
}

.chat-randombox-winners b {
    font-weight: 600;
}

.chat-randombox-winner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.chat-randombox-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: var(--chat-text-soft);
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
}

.chat-randombox-rank.is-top1 {
    background: #f5b82e;
    color: #5c3d00;
}

.chat-randombox-rank.is-top2 {
    background: #c3c8cf;
    color: #374151;
}

.chat-randombox-rank.is-top3 {
    background: #d9935a;
    color: #4a2508;
}

.chat-randombox-winners li.mine,
.chat-randombox-winners li.mine b {
    color: var(--color-accent);
    font-weight: 700;
}

.chat-randombox-winners .chat-empty {
    justify-content: center;
    color: var(--color-muted);
}

.chat-password {
    align-items: center;
    gap: 10px;
}

/* center 정렬은 키보드로 줄면 위가 잘려 스크롤로도 못 봐서 auto 여백으로 가운데 둠 */
.chat-password > :first-child {
    margin-top: auto;
}

.chat-password > :last-child {
    margin-bottom: auto;
}

.chat-password-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--chat-primary-soft);
    color: var(--color-primary-dark);
}

.chat-password .chat-form-title {
    max-width: 100%;
    font-size: 14px;
    text-align: center;
    overflow-wrap: anywhere;
}

.chat-password label,
.chat-password .chat-form-actions {
    width: 220px;
}

.chat-password .chat-form-actions .chat-btn {
    flex: 1;
}

.chat {
    --chat-radius: 8px;
    --chat-radius-sm: 6px;
    --chat-radius-pill: 999px;
    --chat-fill: #f1f3f6;
    --chat-hover: #e5e8ed;
    --chat-primary-soft: var(--color-primary-soft);
    --chat-primary-hover: var(--color-primary-hover);
    --chat-danger-soft: #fdeceb;
    --chat-text-soft: #5f6672;
    --chat-shadow: 0 6px 20px rgba(17, 24, 39, 0.1), 0 1px 3px rgba(17, 24, 39, 0.06);
    --chat-focus-ring: 0 0 0 3px rgba(3, 199, 90, 0.2);
    position: relative;
}

.chat input[type="text"],
.chat input[type="password"],
.chat input[type="search"],
.chat input[type="number"],
.chat select {
    height: 28px;
    padding: 0 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--chat-radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    font-family: inherit;
    font-size: 12px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.chat input[type="text"]:focus,
.chat input[type="password"]:focus,
.chat input[type="search"]:focus,
.chat input[type="number"]:focus,
.chat select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--chat-focus-ring);
}

.chat input:disabled,
.chat select:disabled {
    background: var(--chat-fill);
    color: var(--color-muted);
}

.chat input[type="checkbox"] {
    accent-color: var(--color-primary);
}

/* 메시지 입력칸은 테두리 없는 모양 유지 */
.chat .chat-input input,
.chat .chat-input input:focus {
    flex: 1;
    min-width: 0;
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    outline: none;
    background: transparent;
    box-shadow: none;
    font-size: 13px;
}

.chat ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.chat ::-webkit-scrollbar-track {
    background: transparent;
}

.chat ::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #cdd2da;
}

.chat ::-webkit-scrollbar-thumb:hover {
    background: #aeb4be;
}

@supports not selector(::-webkit-scrollbar) {
    .chat * {
        scrollbar-width: thin;
        scrollbar-color: #cdd2da transparent;
    }
}

.chat-nick {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.chat-nick:hover {
    text-decoration: underline;
}

.chat-list .chat-friend {
    display: inline-flex;
    flex: none;
    margin-bottom: -2px;
    color: var(--color-online);
}

.chat-vote {
    display: inline-flex;
    gap: 2px;
    vertical-align: middle;
    white-space: nowrap;
}

.chat-vote-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    border: 0;
    border-radius: 4px;
    background: none;
    color: var(--color-muted);
    cursor: pointer;
}

/* 버튼 전체를 흐리면 안의 포인트 알림까지 비쳐 보임 */
.chat-vote-btn > :not(.chat-vote-float) {
    opacity: 0.6;
}

.chat-vote-btn:disabled {
    cursor: default;
}

.chat-vote-btn:hover:not(:disabled) {
    background: var(--color-fill-strong);
}

.chat-vote-btn:hover:not(:disabled) > :not(.chat-vote-float),
.chat-vote-btn--up > :not(.chat-vote-float),
.chat-vote-btn--down > :not(.chat-vote-float) {
    opacity: 1;
}

.chat-vote-btn--up {
    color: var(--color-primary-dark);
}

.chat-vote-btn--down {
    color: var(--color-error);
}

.chat-vote-n {
    font-size: 11px;
    line-height: 1;
}

.chat-vote-float {
    position: absolute;
    bottom: 100%;
    left: 50%;
    padding: 2px 9px;
    border: 1px solid var(--color-primary-outline);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-primary-dark);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    pointer-events: none;
    opacity: 0;
    animation: chat-vote-float 1.2s ease-out;
}

@keyframes chat-vote-float {
    0% { opacity: 0; transform: translate(-50%, 4px); }
    20% { opacity: 1; transform: translate(-50%, 0); }
    75% { opacity: 1; transform: translate(-50%, -6px); }
    100% { opacity: 0; transform: translate(-50%, -10px); }
}

@keyframes chat-vote-fade {
    0%, 80% { opacity: 1; transform: translateX(-50%); }
    100% { opacity: 0; transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .chat-vote-float {
        animation-name: chat-vote-fade;
    }
}

.point-toast {
    position: fixed;
    top: 96px;
    left: 50%;
    z-index: 1000;
    padding: 8px 18px;
    border: 1px solid var(--color-primary-outline);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-primary-dark);
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    opacity: 0;
    animation: point-toast 1.5s ease-out forwards;
}

@keyframes point-toast {
    0% { opacity: 0; transform: translate(-50%, 8px); }
    15% { opacity: 1; transform: translate(-50%, 0); }
    75% { opacity: 1; transform: translate(-50%, -6px); }
    100% { opacity: 0; transform: translate(-50%, -14px); }
}

@media (max-width: 767px) {
    .point-toast {
        top: 64px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .point-toast {
        animation-name: chat-vote-fade;
    }
}

.chat-list li.chat-admin-notice {
    margin: 4px 0;
    padding: 6px 8px 6px 10px;
    border-left: 3px solid var(--color-primary);
    border-radius: 3px var(--chat-radius) var(--chat-radius) 3px;
    background: var(--chat-primary-soft);
}

/* 입장·나가기 안내는 대화와 섞이지 않게 가운데 회색 줄로 */
.chat-list li.chat-room-event:not(.chat-empty) {
    padding: 5px 12px;
    color: var(--chat-text-soft);
    font-size: 12px;
    text-align: center;
}

/* 시간만 있어서 날짜 바뀌는 곳에 구분선 */
.chat-list li.chat-room-event.chat-date-line {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border-color: transparent;
}

.chat-list li.chat-room-event.chat-date-line::before,
.chat-list li.chat-room-event.chat-date-line::after {
    content: "";
    flex: 1;
    border-top: 1px solid currentColor;
    opacity: 0.35;
}

.chat-list li.chat-admin-notice .chat-msg-nick,
.chat-admin-icon {
    color: var(--color-primary-dark);
}

.chat-admin-icon {
    flex: none;
    align-self: center;
}

.chat-list .chat-hidden {
    color: var(--color-muted);
    font-style: italic;
}

.chat-menu {
    position: absolute;
    z-index: 10;
    width: 150px;
    padding: 4px;
    border: 1px solid var(--color-border);
    border-radius: var(--chat-radius);
    background: var(--color-surface);
    box-shadow: var(--chat-shadow);
    font-size: 12px;
}

.chat-menu-title {
    display: block;
    margin-bottom: 4px;
    padding: 6px 8px 8px;
    border-bottom: 1px solid var(--color-border);
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 30px;
    padding: 0 8px;
    border: 0;
    border-radius: var(--chat-radius-sm);
    background: none;
    color: inherit;
    font-family: inherit;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.chat-menu button .chat-icon {
    flex: none;
    color: var(--chat-text-soft);
}

.chat-menu button:hover:not(:disabled) {
    background: var(--chat-fill);
}

.chat-menu button:focus-visible {
    outline: none;
    box-shadow: var(--chat-focus-ring);
}

.chat-menu button:disabled {
    color: var(--color-muted);
    cursor: default;
}

.chat-menu button:disabled .chat-icon {
    color: inherit;
}

.chat-menu button.is-danger:not(:disabled),
.chat-menu button.is-danger:not(:disabled) .chat-icon {
    color: var(--color-accent);
}

.chat-menu button.is-danger:hover:not(:disabled) {
    background: var(--chat-danger-soft);
}

.chat-menu button.is-off,
.chat-btn.is-off {
    color: var(--chat-text-soft);
}

.chat-menu-hint {
    margin: 0;
    padding: 4px 8px;
    color: var(--color-muted);
    font-size: 11px;
}

.chat-menu-hint.error,
.chat-profile-note.error {
    color: var(--color-accent);
}

/* 채팅 밖 페이지 닉네임, 글자 모양은 그대로 */
.member-nick {
    cursor: pointer;
}

.member-nick:hover,
.member-nick:focus-visible {
    text-decoration: underline;
}

/* 페이지 위 회원 메뉴·회원정보, .chat은 변수만 빌려 씀 */
.member-layer {
    display: contents;
}

.member-layer .chat-menu {
    position: fixed;
    z-index: 900;
}

.member-layer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.45);
}

.member-layer-backdrop .chat-panel {
    width: 100%;
    max-width: 360px;
    height: auto;
    max-height: 100%;
    border-radius: var(--chat-radius);
    background: var(--color-surface);
    box-shadow: var(--chat-shadow);
}

.member-layer > .member-layer-toast {
    position: fixed;
    top: 16px;
    left: 50%;
    z-index: 900;
    max-width: calc(100vw - 32px);
    border-radius: var(--chat-radius);
    box-shadow: var(--chat-shadow);
    transform: translateX(-50%);
}

.chat-profile,
.chat-invite {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 12px;
}

.chat-panel-head {
    display: flex;
    flex: none;
    align-items: center;
    gap: 6px;
    min-height: 24px;
}

.chat-invite .chat-panel-head {
    justify-content: space-between;
}

.chat-panel .chat-error {
    padding: 0;
}

.chat-profile-name {
    display: flex;
    align-items: center;
    min-width: 0;
}

.chat-profile-nick {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-profile-rank {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 4px;
    color: var(--color-primary-dark);
    font-size: 12px;
    font-style: normal;
    font-weight: 600;
}

.chat-profile-rank img {
    width: auto;
    height: 18px;
}

.chat-profile-rank--text {
    padding: 0 8px;
    border-radius: var(--chat-radius-pill);
    background: var(--chat-primary-soft);
    font-size: 11px;
    line-height: 20px;
}

.chat-profile-note {
    margin: 0;
    color: var(--color-muted);
}

.chat-profile-info {
    display: grid;
    flex: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 0;
}

.chat-profile-info div {
    padding: 6px 8px;
    border-radius: var(--chat-radius-sm);
    background: var(--chat-fill);
}

.chat-profile-info dt {
    color: var(--color-muted);
    font-size: 11px;
}

.chat-profile-info dd {
    margin: 2px 0 0;
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-profile-subtitle {
    font-size: 12px;
    font-weight: 600;
}

.chat-profile-posts {
    flex: none;
    margin: -6px 0 0;
    padding: 0;
    list-style: none;
}

.chat-profile-posts li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid var(--color-border);
}

.chat-profile-posts a {
    overflow: hidden;
    color: inherit;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-profile-posts a:hover {
    color: var(--color-primary-dark);
}

.chat-profile-posts time {
    flex: none;
    color: var(--color-muted);
    font-size: 11px;
}

.chat-profile-posts .chat-empty {
    justify-content: center;
    color: var(--color-muted);
}

.chat-profile-actions {
    display: flex;
    flex: none;
    flex-wrap: wrap;
    gap: 6px;
}

.chat-friend-list {
    flex: none;
    margin: 0;
    padding: 0;
    list-style: none;
}

.chat-friend-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--chat-radius-sm);
    transition: background-color 0.15s;
}

.chat-friend-list li:hover {
    background: var(--chat-fill);
}

.chat-friend-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-friend-rank {
    color: var(--color-muted);
    font-size: 11px;
    font-style: normal;
}

img.chat-friend-rank {
    flex: none;
    width: auto;
    height: 16px;
}

.chat-friend-list .online-dot {
    flex: none;
    margin-right: 0;
}

.chat-friend-list .chat-empty {
    justify-content: center;
    padding: 16px 0;
    color: var(--color-muted);
}

.chat .online-dot {
    flex: none;
    box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 3px var(--color-border);
}

.chat .online-dot.is-online {
    box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 3px rgba(47, 179, 68, 0.3);
}

.chat-alerts {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    padding: 6px 10px;
    border-bottom: 1px solid var(--color-border);
    list-style: none;
}

.chat-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 4px 4px 10px;
    border: 1px solid transparent;
    border-radius: var(--chat-radius);
    font-size: 12px;
}

.chat-alert--invite {
    border-color: #cfe4f5;
    background: var(--chat-primary-soft);
}

.chat-alert--friend {
    border-color: #cbead3;
    background: #ebf8ee;
}

.chat-alert-icon {
    flex: none;
}

.chat-alert--invite .chat-alert-icon {
    color: var(--color-primary-dark);
}

.chat-alert--friend .chat-alert-icon {
    color: #1f8a33;
}

.chat-alert-text {
    flex: 1;
    min-width: 0;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.auth-box {
    width: 420px;
    max-width: 100%;
    margin: 0 auto;
}

.auth-notice {
    margin: 0 0 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--color-primary-soft);
    color: var(--color-primary-dark);
    font-size: 15px;
    font-weight: 700;
}

.auth-notice::before {
    content: "✓";
    margin-right: 8px;
}

.auth-notice.error {
    background: var(--color-error-soft);
    color: var(--color-error);
}

.auth-notice.error::before {
    content: "!";
}

/* 인증 권유·일반 안내는 완료 안내가 아니라 원래 흰 상자로 둔다 */
.auth-notice.phone-nudge,
.auth-notice.info {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: inherit;
    font-weight: 400;
}

.auth-notice.phone-nudge::before,
.auth-notice.info::before {
    content: none;
}

.post-form label.auth-check {
    flex-direction: row;
    align-items: center;
}

.member-menu--in {
    gap: 10px;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    vertical-align: middle;
}

.rank-icon {
    display: block;
    width: auto;
    height: 20px;
    aspect-ratio: 1 / 1;
}

.rank-badge--label {
    color: var(--color-primary-dark);
    font-weight: 700;
}

.mypage-rank-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mypage-rank-head .rank-badge--label {
    font-size: 14px;
}

.mypage-rank-head .rank-icon {
    height: 20px;
}

.member-points {
    font-weight: 700;
}

.logout-form {
    margin: 0;
}

.mypage-rank,
.mypage-history,
.mypage-form {
    margin-bottom: 16px;
}

.mypage-history {
    overflow: hidden;
}

/* 표 아래 번호 줄이 다음 상자와 붙지 않게 */
.mypage-history + .pagination {
    margin: 0 0 32px;
}

.history-when span {
    white-space: nowrap;
}

.mypage-form > h2 {
    margin-bottom: 8px;
}

/* .actions·모바일 .page .btn의 display가 hidden을 덮어서 한 단계 더 세게 */
.mypage-push [hidden],
.mypage-push .btn[hidden] {
    display: none;
}

.mypage-push .push-status {
    margin: 0;
    color: var(--color-muted);
}

.mypage-push .actions {
    justify-content: flex-start;
    margin-top: 0;
}

.push-types {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin: 0;
    padding: 0;
    border: 0;
}

.push-types legend {
    margin-bottom: 8px;
    padding: 0;
    font-weight: 700;
}

.post-form .push-types label {
    flex-direction: row;
    align-items: center;
}

.push-types input {
    accent-color: var(--color-primary);
}

.push-saved {
    min-height: 1.5em;
    margin: 0;
    color: var(--color-muted);
    font-size: 13px;
}

.mypage-history th:nth-child(2),
.mypage-history th:last-child,
.mypage-history td:nth-child(2):not(.empty),
.mypage-history td:last-child:not(.empty) {
    text-align: left;
}

.bet-won {
    color: var(--color-primary-dark);
    font-weight: 700;
}

.bet-table .col-when { width: 150px; }
.bet-table .col-odds,
.bet-table .col-result { width: 72px; }
.bet-table .col-amount,
.bet-table .col-payout { width: 100px; }

.bet-table th:nth-child(3) { text-align: left; }

.bet-table .bet-race,
.bet-table .bet-pick {
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
}

/* 플레이 내역 창은 경기 칸이 시각뿐이라 머리글처럼 가운데로 */
@media (min-width: 1024px) {
    .vr-bet-history .bet-table .bet-race { text-align: center; }
}

.progress {
    height: 10px;
    background: var(--color-border);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-online), var(--color-primary));
}

.mypage-rank {
    padding: 20px 24px;
}

.mypage-rank-head strong {
    font-size: 16px;
}

.mypage-info {
    display: grid;
    gap: 6px;
    margin: 0;
}

.mypage-info > div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mypage-info dt {
    width: 56px;
    flex: none;
    font-weight: 700;
}

.mypage-info dd {
    margin: 0;
}

.mypage-info a {
    margin-left: 8px;
    color: var(--color-primary-dark);
    font-weight: 700;
}

.mypage-rank .mypage-rank-progress {
    margin: 16px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--color-line-soft);
}

.mypage-rank-progress .side-rank-head {
    font-size: 13px;
}

.mypage-rank-progress .side-rank-head strong {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.mypage-rank-progress .side-rank-next {
    font-size: 12px;
}

.mypage-activity {
    margin-bottom: 16px;
}

.activity-summary {
    margin: 0;
    color: var(--color-muted);
}

.activity-summary strong {
    color: var(--color-text);
}

.activity-tabs {
    display: flex;
    gap: 4px;
    padding: 0 12px;
    border-bottom: 1px solid var(--color-border);
}

.activity-tabs a {
    position: relative;
    padding: 12px 14px 11px;
    color: var(--color-muted);
    font-size: 14px;
}

.activity-tabs a em {
    margin-left: 2px;
    font-size: 12px;
    font-style: normal;
}

.activity-tabs a:hover {
    color: var(--color-text);
}

.activity-tabs a.active {
    color: var(--color-primary-dark);
    font-weight: 700;
}

.activity-tabs a.active::after {
    content: "";
    position: absolute;
    right: 8px;
    bottom: -1px;
    left: 8px;
    height: 2px;
    border-radius: 2px;
    background: var(--color-primary);
}

.activity-table .col-board {
    width: 130px;
    overflow: hidden;
    color: var(--color-muted);
    text-overflow: ellipsis;
}

.activity-table .col-rank {
    width: 70px;
}

.activity-table .col-rank .rank-badge {
    justify-content: center;
}

.activity-title {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.activity-title a {
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-title a:hover,
.activity-comment a:hover .activity-comment-text {
    color: var(--color-primary-dark);
}

.activity-count {
    flex: none;
    color: var(--color-accent);
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
}

.activity-tag {
    flex: none;
    display: inline-block;
    padding: 1px 6px;
    border: 1px solid var(--color-border);
    border-radius: 9px;
    background: var(--color-bg);
    color: var(--color-muted);
    font-size: 12px;
    line-height: 16px;
}

.activity-tag--blind {
    border-color: #f5c6c5;
    background: #fdf0f0;
    color: var(--color-accent);
}

.activity-table td.activity-comment {
    padding-top: 10px;
    padding-bottom: 10px;
    white-space: normal;
}

.activity-comment a {
    display: block;
}

.activity-comment-text {
    display: -webkit-box;
    overflow: hidden;
    line-height: 19px;
    word-break: break-all;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.activity-comment-post {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    min-width: 0;
}

.activity-comment-origin {
    overflow: hidden;
    color: var(--color-muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-referrer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 16px;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg);
}

.activity-referrer-label {
    color: var(--color-muted);
}

.activity-muted {
    color: var(--color-muted);
}

.activity-pagination {
    margin: 0;
    padding: 16px;
}

.coupon-table .col-code {
    width: 320px;
}

.coupon-table .col-site {
    width: 70px;
}

.coupon-table .col-status {
    width: 170px;
}

.coupon-table .coupon-code-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.coupon-table .coupon-code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    user-select: all;
}

.coupon-table .coupon-copy {
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
}

.coupon-table .coupon-copy-status {
    color: var(--color-muted);
    font-size: 12px;
}

.coupon-table .coupon-site {
    color: var(--color-primary-dark);
}

.coupon-table .coupon-revoked {
    color: var(--color-accent);
}

/* 이력 상자 공통 왼쪽 정렬에서 상태 칸은 빼 둠 */
.mypage-history .coupon-table th:last-child,
.mypage-history .coupon-table td:last-child:not(.empty) {
    text-align: center;
}

.comments {
    margin-top: 16px;
    padding: 16px 24px;
}

.comments-head {
    margin: 0 0 12px;
    font-size: 16px;
}

.comments-head em {
    color: var(--color-accent);
    font-style: normal;
}

.comment-list,
.comment-replies {
    margin: 0;
    padding: 0;
    list-style: none;
}

.comment {
    padding: 12px 0;
    border-top: 1px solid var(--color-border);
}

.comment-replies {
    margin-top: 8px;
}

.comment--reply {
    padding-left: 28px;
    background: var(--color-fill-soft);
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-muted);
}

.comment-author {
    color: var(--color-text);
}

.comment-content {
    margin: 6px 0;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
}

.comment-placeholder,
.comment-empty,
.comment-guest {
    margin: 0;
    color: var(--color-muted);
}

.comment-empty {
    padding: 12px 0;
    border-top: 1px solid var(--color-border);
}

.comment-actions {
    display: flex;
    gap: 8px;
}

.comment-inline {
    margin: 0;
}

.comment-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-muted);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.comment-link--danger {
    color: var(--color-accent);
}

@media (min-width: 769px) {
    .comment-link {
        position: relative;
    }

    .comment-link::after {
        content: "";
        position: absolute;
        inset: -6px -4px;
    }
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.comment-form[hidden] {
    display: none;
}

.comment-form textarea {
    min-height: 72px;
    resize: vertical;
}

.comment-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.comment-form--new {
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}

.comment-guest {
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}

.member-messages em {
    display: inline-block;
    min-width: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--color-border);
    color: var(--color-muted);
    font-style: normal;
    font-size: 11px;
    text-align: center;
}

.member-messages em.is-unread {
    background: var(--color-accent);
    color: #fff;
}

.message-row.is-unread a {
    font-weight: 700;
}

.message-new {
    margin-right: 6px;
    color: var(--color-accent);
    font-size: 12px;
}

.member-friends em,
.page-tabs .friend-count {
    display: inline-block;
    min-width: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--color-accent);
    color: #fff;
    font-style: normal;
    font-size: 11px;
    text-align: center;
}

.member-friends em[hidden],
.page-tabs .friend-count[hidden] {
    display: none;
}

.page-tabs {
    margin: 0 0 12px;
    padding: 0 4px;
}

/* 긴 글이라 폭을 줄이고 가운데 둠, 공통 main 규칙의 margin 0을 덮음 */
.policy.inner {
    max-width: 960px;
    margin: 0 auto;
}

.policy-doc {
    padding: 32px 40px 40px;
    color: var(--color-text);
    font-size: 15px;
    line-height: 1.75;
}

.policy-doc > :first-child {
    margin-top: 0;
}

.policy-doc h2 {
    margin: 36px 0 12px;
    padding-top: 20px;
    border-top: 1px solid var(--color-line-soft);
    font-size: 19px;
}

.policy-doc h3 {
    margin: 22px 0 8px;
    font-size: 16px;
}

.policy-doc p,
.policy-doc ol,
.policy-doc ul {
    margin: 0 0 10px;
}

.policy-doc ol,
.policy-doc ul {
    padding-left: 22px;
}

.policy-doc li + li {
    margin-top: 4px;
}

/* 편집기가 목록·칸 글을 p로 감쌈 */
.policy-doc :is(li, td, th, blockquote) > p {
    margin: 0;
}

/* 첫 h2 앞 머리글 */
.policy-doc > p:not(h2 ~ p) {
    color: var(--color-muted);
}

.policy-toc {
    margin: 16px 0 8px;
    padding: 16px 20px;
    border-radius: 10px;
    background: var(--color-fill-soft);
    font-size: 14px;
}

.policy-toc :is(ol, ul) {
    columns: 2;
    column-gap: 32px;
    margin: 0;
}

/* 약관 목차는 "제N장"이 번호라 목록 번호를 뺌 */
.policy-toc ul {
    padding-left: 0;
    list-style: none;
}

.policy-doc blockquote {
    margin: 12px 0;
    padding: 12px 16px;
    border-left: 3px solid var(--color-primary);
    border-radius: 0 8px 8px 0;
    background: var(--color-primary-soft);
    font-size: 14px;
}

.policy-table-wrap {
    margin: 8px 0 14px;
    overflow-x: auto;
}

.policy-doc table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.6;
}

.policy-doc th,
.policy-doc td {
    padding: 9px 12px;
    border: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}

.policy-doc th {
    background: var(--color-head-bg);
    font-weight: 700;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .policy-doc {
        padding: 20px 16px 28px;
        font-size: 14px;
    }

    .policy-toc :is(ol, ul) {
        columns: 1;
    }

    .policy-tabs {
        overflow-x: auto;
        white-space: nowrap;
    }
}

.online-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--color-scheduled);
    vertical-align: middle;
}

.online-dot.is-online {
    background: var(--color-online);
}

.board-table .col-manage { width: 170px; }
.board-table .col-state { width: 80px; }

.form-hint {
    margin: 0;
    color: var(--color-muted);
    font-size: 13px;
}

.message-hint {
    margin-top: 8px;
    text-align: right;
}

.message-report {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
    padding: 12px;
}

.message-report > span {
    margin-right: auto;
    color: var(--color-muted);
}

.message-report textarea {
    flex-basis: 100%;
    min-height: 72px;
    resize: vertical;
}

.row-actions {
    display: flex;
    justify-content: center;
    gap: 4px;
}

.row-actions form {
    margin: 0;
}

.row-actions .btn {
    padding: 4px 10px;
    font-size: 12px;
}

.vote-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    padding: 0 24px 24px;
}

.vote-buttons {
    grid-column: 2;
    display: flex;
    gap: 8px;
}

.vote-bar .vote-report {
    grid-column: 3;
    justify-self: end;
}

.vote-bar .vote-status {
    grid-column: 1 / -1;
    text-align: center;
}

.vote-btn em,
.comment-votes em {
    margin-left: 2px;
    font-style: normal;
}

.btn.is-voted {
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
}

.btn.is-voted:disabled,
.comment-link.is-voted:disabled {
    opacity: 1;
}

.btn.is-voted:disabled {
    background: var(--color-surface);
    cursor: default;
}

.comment-votes {
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-link:disabled {
    opacity: 0.6;
    cursor: default;
}

.comment-link.is-voted {
    color: var(--color-primary-dark);
}

/* 게시글·댓글 버튼 아이콘 */
.ic {
    width: 16px;
    height: 16px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.vote-bar .btn,
.actions .btn {
    gap: 6px;
}

.actions .btn:not(.btn-danger) .ic {
    color: var(--color-muted);
}

.vote-btn {
    height: 42px;
    padding: 0 20px;
    border-radius: 999px;
    font-size: 14px;
}

.vote-btn .ic {
    width: 18px;
    height: 18px;
}

.vote-btn em {
    margin-left: 0;
    font-weight: 700;
}

.vote-btn.is-voted .ic {
    fill: currentColor;
    fill-opacity: 0.2;
}

.vote-btn[data-vote="LIKE"]:hover:not(:disabled),
.vote-btn[data-vote="LIKE"].is-voted:disabled {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
    color: var(--color-primary-dark);
}

.vote-btn[data-vote="DISLIKE"]:hover:not(:disabled),
.vote-btn[data-vote="DISLIKE"].is-voted:disabled {
    border-color: var(--color-accent);
    background: var(--color-error-soft);
    color: var(--color-accent);
}

.vote-bar .vote-report {
    padding: 0 12px;
    border-color: transparent;
    background: none;
    color: var(--color-muted);
}

.vote-bar .vote-report:hover:not(:disabled) {
    background: var(--color-error-soft);
    color: var(--color-accent);
}

.vote-bar .vote-report:disabled {
    color: var(--color-scheduled);
}

.comment-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.comment-link .ic {
    width: 14px;
    height: 14px;
}

.comment-link em {
    margin-left: 0;
}

.comment-link:hover:not(:disabled) {
    color: var(--color-text);
}

.comment-link--danger:hover:not(:disabled),
.comment-link[data-report-url]:hover:not(:disabled),
.comment-link[data-vote="DISLIKE"].is-voted {
    color: var(--color-accent);
}

.comment-link.is-voted .ic {
    fill: currentColor;
    fill-opacity: 0.2;
}

.vote-status {
    color: var(--color-muted);
    font-size: 12px;
}

.vote-status:empty {
    display: none;
}

.post-detail h1.post-blinded,
.board-table .title a.is-blinded,
.gallery-title.is-blinded {
    color: var(--color-muted);
}

.board-table .col-like { width: 70px; }

.board-table .pinned-row td {
    background: var(--color-bg);
}

.pinned-list {
    padding: 4px 16px;
    border-bottom: 1px solid var(--color-border);
}

.pinned-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    white-space: nowrap;
}

.pinned-list a {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pinned-meta {
    color: var(--color-muted);
    font-size: 12px;
}

.report-dialog {
    width: 360px;
    max-width: calc(100% - 32px);
    padding: 20px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
}

.report-dialog::backdrop {
    background: rgba(0, 0, 0, 0.35);
}

.report-dialog h2 {
    margin: 0 0 12px;
    font-size: 16px;
}

.report-reasons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0 0 12px;
    padding: 0;
    border: 0;
}

.report-reasons legend {
    margin-bottom: 6px;
    padding: 0;
    color: var(--color-muted);
    font-size: 13px;
}

.report-dialog textarea {
    width: 100%;
    min-height: 72px;
    resize: vertical;
}

.report-error {
    margin: 8px 0 0;
    color: var(--color-accent);
    font-size: 13px;
}

.report-error:empty {
    display: none;
}

.report-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.sports-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

/* 아래 멀티뷰 탭과 층이 갈리게 띠로 감싸고 고른 종목은 초록으로 채움 */
.sports-tabs--sport {
    padding: 4px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    width: fit-content;
    max-width: 100%;
}

.sports-tabs--sport a {
    padding: 10px 18px;
    font-size: 15px;
}

.sports-tabs--sport a.active {
    background: var(--color-primary);
    color: #ffffff;
    box-shadow: none;
}

@media (max-width: 768px) {
    .sports-tabs--sport {
        width: auto;
    }

    .sports-tabs--sport a {
        flex: 1 0 auto;
        padding: 8px 12px;
    }
}

.sports-frame {
    display: block;
    width: 100%;
    height: 1200px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
}
@media (max-width: 1023px) and (max-height: 500px) {
    :root .sports-frame {
        height: calc(100dvh - 56px);
        min-height: 250px;
    }
}

.sports-frame-open {
    margin: 0 0 8px;
    font-size: 13px;
    text-align: right;
}

/* 라이브스코어 */
.sg-head {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

/* 메인 리그가 많아 PC에서도 넘치는 탭은 가로로 밀어 봄 */
.sg-head > .vr-tabs {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.sg-head > .vr-tabs::-webkit-scrollbar {
    display: none;
}

.sg-head > .vr-tabs > * {
    flex-shrink: 0;
}

.sg-live-count {
    align-self: center;
    margin-left: 4px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--color-fill);
    color: var(--color-text);
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
    line-height: 18px;
}

.vr-tabs__tab.is-active .sg-live-count {
    background: var(--color-primary);
    color: #fff;
}

.sg-find {
    flex: none;
    max-width: 220px;
    height: 46px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
}

.sg-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--color-border);
}

.sg-bar .view-toggle {
    margin-left: 0;
}

.sg-season {
    color: var(--color-muted);
    font-size: 13px;
}

.sg-empty {
    margin: 0;
    padding: 48px 16px;
    color: var(--color-muted);
    text-align: center;
}

.sg-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

/* 펼친 이닝 표가 안에 들어가서 바깥 표 칸만 고름 */
.sg-table > thead > tr > th,
.sg-table > tbody > tr > td {
    height: 44px;
    padding: 0 8px;
    border-bottom: 1px solid var(--color-line-soft);
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sg-table > thead > tr > th {
    height: 36px;
    background: var(--color-head-bg);
    color: var(--color-muted);
    font-weight: 400;
}

.sg-table .sg-col-time {
    width: 100px;
}

.sg-table .sg-col-league {
    width: 110px;
}

.sg-table .sg-col-score {
    width: 96px;
}

.sg-table .sg-col-status {
    width: 96px;
}

.sg-when span {
    color: var(--color-muted);
}

.sg-league {
    color: var(--color-muted);
    font-size: 13px;
}

.sg-table .left {
    text-align: left;
}

.sg-table .right {
    text-align: right;
}

.sg-team img {
    width: 20px;
    height: 20px;
    margin: 0 6px;
    object-fit: contain;
    vertical-align: -5px;
}

.sg-score {
    font-size: 15px;
    font-weight: 700;
}

.sg-score em {
    color: var(--color-live);
    font-style: normal;
}

.sg-vs {
    color: var(--color-muted);
    font-weight: 400;
}

td.sg-status {
    color: var(--color-muted);
    font-size: 12px;
}
.sg-table div.sg-status {
    display: none;
}

.sg-status--live {
    color: var(--color-muted);
    font-weight: 700;
}

.sg-row[aria-expanded] {
    cursor: pointer;
}

.sg-row[aria-expanded]:hover > td,
.sg-row[aria-expanded="true"] > td {
    background: var(--color-head-bg);
}

.sg-table > tbody > .sg-period-row > td {
    height: auto;
    padding: 10px 12px;
    background: var(--color-fill-soft);
    white-space: normal;
}

.sg-periods-wrap {
    overflow-x: auto;
}

.sg-periods {
    margin: 0 auto;
    border-collapse: collapse;
    font-size: 12px;
}

.sg-periods th,
.sg-periods td {
    min-width: 28px;
    height: 26px;
    padding: 0 4px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    text-align: center;
}

.sg-periods thead th {
    background: var(--color-head-bg);
    color: var(--color-muted);
    font-weight: 400;
}

.sg-periods tbody th {
    min-width: 72px;
    padding: 0 8px;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
}

.sg-periods .sg-total {
    font-weight: 700;
}

.sg-scroll {
    overflow-x: auto;
}

.sg-standing {
    min-width: 800px;
}

.sg-standing > thead > tr > th:nth-child(n) {
    width: auto;
}

.sg-standing > thead > tr > th:nth-child(1) {
    width: 52px;
}

.sg-standing > thead > tr > th:nth-child(2) {
    width: 30%;
}

.sg-standing > thead > tr > th:last-child {
    width: 216px;
}

.sg-points {
    font-weight: 700;
}

.sg-form {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    margin-right: 2px;
    border-radius: 4px;
    background: var(--color-form-draw);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}

.sg-form--W {
    background: var(--color-primary);
}

.sg-form--L {
    background: var(--color-live);
}

@media (max-width: 768px) {
    .sg-head {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .sg-find {
        max-width: none;
        margin-bottom: 12px;
    }

    .sg-bar {
        padding: 10px 12px;
    }

    .sg-table > thead > tr > th,
    .sg-table > tbody > tr > td {
        padding: 4px;
        font-size: 12px;
    }

    .sg-table .sg-col-time {
        width: 44px;
    }

    .sg-table td.sg-when {
        line-height: 1.18;
    }

    .sg-table .sg-col-league {
        width: 48px;
    }

    /* 세 자리 점수도 안 잘리게, 남는 폭은 팀 칸이 줄어듦 */
    .sg-table .sg-col-score {
        width: 70px;
    }

    .sg-table .sg-col-status {
        display: none;
    }
    .sg-table td.sg-status {
        display: none;
    }
    .sg-table div.sg-status {
        display: block;
        text-wrap: wrap;
        width: min-content;
        max-width: 100%;
        word-break: keep-all;
        overflow-wrap: break-word;
    }

    /* 좁은 화면은 날짜를 시각 위 줄로 */
    .sg-when span {
        display: block;
        font-size: 11px;
    }

    .sg-league {
        font-size: 11px;
        overflow: visible !important;
        text-align: left !important;
        text-overflow: clip !important;
        white-space: normal !important;
    }

    .sg-team img {
        margin: 0 4px;
    }

    .sg-standing > thead > tr > th:nth-child(1) {
        width: 40px;
    }
}

/* 가상경기 */
:root {
    --vr-line: var(--color-primary);
    --vr-head-bg: var(--color-head-bg);
    --vr-row-line: var(--color-fill-strong);
    --vr-scroll-thumb: rgba(0, 0, 0, 0.1);
    --vr-freeze-line: var(--color-border);
    --vr-scroll-thumb-hover: rgba(0, 0, 0, 0.4);
    --vr-text-sub: #555555;
    --vr-blue: #0a6fb4;
    --vr-blue-soft: #e3f1fb;
    --vr-red: #c62828;
    --vr-red-soft: #fde6e5;
    --vr-gold: #916600;
    --vr-gold-soft: #fbf1d3;
    --vr-silver: #616a77;
    --vr-silver-soft: var(--color-fill-strong);
    --vr-bronze: #7f4420;
    --vr-bronze-soft: #f8e9de;
    --vr-orange: #ad5100;
    --vr-orange-soft: #fdebd9;
    --vr-olive: #5f6b12;
    --vr-olive-soft: #eff2d8;
    --vr-teal: #0b8a80;
    --vr-green: #2b8a3e;
    --vr-purple: #6741d9;
    --vr-on-tone: #ffffff;
}

.vr-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vr-part__caption {
    margin: 0;
    padding: 0 12px 8px;
    border-bottom: 1px solid var(--color-border);
    font-size: 12px;
    display: flex;
}
.vr-part__caption__text {
    display: inline-flex;
    gap: 8px;
}
.vr-part__caption__vlet {
    display: inline-block;
    width: 4px;
    height: 16px;
    background: var(--color-primary-dark);
}

.vr-part__empty {
    margin: 0;
    padding: 16px 12px;
    color: var(--color-muted);
}

.vr-part__band {
    margin: 0;
    padding: 6px 12px;
    border-bottom: 1px solid var(--color-border);
    background: var(--vr-head-bg);
    color: var(--vr-text-sub);
    font-size: 12px;
    font-weight: 700;
}

.vr-part .vr-table-wrap + .vr-table-wrap,
.vr-part .vr-table-wrap + .vr-part__band {
    border-top: 1px solid var(--color-border);
}

.vr-table-wrap {
    overflow-x: auto;
}

.vr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.vr-table th,
.vr-table td {
    height: 28px;
    padding: 0 8px;
    border-bottom: 1px solid var(--vr-row-line);
    text-align: left;
    white-space: nowrap;
}

.vr-table th {
    background: var(--vr-head-bg);
    color: var(--vr-text-sub);
    font-weight: 700;
}

.vr-table th:first-child,
.vr-table td:first-child {
    padding-left: 12px;
}

.vr-table th:last-child,
.vr-table td:last-child {
    padding-right: 12px;
}

.vr-table tbody tr:last-child td {
    border-bottom: 0;
}

.vr-table .vr-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.vr-table .vr-cell-stack {
    height: auto;
    padding-top: 4px;
    padding-bottom: 4px;
    line-height: 1.3;
}

/* 색 칸 위에서도 빈 값은 회색으로 */
.vr-table .vr-muted,
.vr-muted {
    color: var(--color-muted);
}

.vr-cell-main {
    color: var(--color-text);
    font-weight: 600;
}

.vr-cell-sub {
    color: var(--color-muted);
    font-size: 11px;
}

.vr-rate {
    color: var(--vr-blue);
    font-weight: 600;
}

.vr-rate--high {
    color: var(--vr-red);
    font-weight: 700;
}

.vr-streak-max {
    color: var(--vr-green);
    font-weight: 700;
}

.vr-tone--r1,
.vr-tone--o10 {
    background: var(--vr-gold-soft);
    color: var(--vr-gold);
    font-weight: 600;
}

.vr-tone--r2 {
    background: var(--vr-silver-soft);
    color: var(--vr-silver);
    font-weight: 600;
}

.vr-tone--r3,
.vr-tone--r34 {
    background: var(--vr-bronze-soft);
    color: var(--vr-bronze);
    font-weight: 600;
}

.vr-tone--r5 {
    background: var(--vr-olive-soft);
    color: var(--vr-olive);
    font-weight: 600;
}

.vr-tone--o17 {
    background: var(--vr-orange-soft);
    color: var(--vr-orange);
    font-weight: 600;
}

.vr-tone--o21,
.vr-tone--rlow {
    background: var(--vr-red-soft);
    color: var(--vr-red);
    font-weight: 600;
}

.vr-tone--o30 {
    background: var(--vr-blue-soft);
    color: var(--vr-blue);
    font-weight: 600;
}

.vr-boxes {
    display: grid;
    grid-template-columns: repeat(10, 28px);
    gap: 2px;
    margin: 0;
    padding: 12px;
    list-style: none;
}

.vr-box {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: var(--vr-head-bg);
    color: var(--vr-text-sub);
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.vr-box--inline {
    display: inline-flex;
    min-width: 28px;
    height: 22px;
    padding: 0 8px;
}

.vr-rank--r1 {
    border-color: transparent;
    background: var(--vr-gold);
    color: var(--vr-on-tone);
}

.vr-rank--r2 {
    border-color: transparent;
    background: var(--vr-silver);
    color: var(--vr-on-tone);
}

.vr-rank--r3 {
    border-color: transparent;
    background: var(--vr-bronze);
    color: var(--vr-on-tone);
}

.vr-rank--r4 {
    border-color: transparent;
    background: var(--vr-orange);
    color: var(--vr-on-tone);
}

.vr-rank--r5 {
    border-color: transparent;
    background: var(--vr-red);
    color: var(--vr-on-tone);
}

.vr-group {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    border-bottom: 1px solid var(--color-border);
    background: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.vr-group:hover {
    background: var(--vr-head-bg);
}

.vr-group:focus-visible {
    outline: 2px solid var(--vr-line);
    outline-offset: -2px;
}

.vr-group__arrow {
    width: 12px;
    color: var(--color-muted);
}

.vr-group__detail {
    border-bottom: 1px solid var(--color-border);
    background: var(--color-fill-soft);
}

.vr-name--repeat {
    color: var(--vr-teal);
    font-weight: 700;
}

.vr-first {
    color: var(--vr-gold);
    font-weight: 600;
}

.vr-points {
    color: var(--vr-green);
    font-weight: 700;
}

/* 메달 칸 위에서도 보라 글자가 보이게 span에 단다 */
.vr-odds-high {
    color: var(--vr-purple);
    font-weight: 700;
}

.vr-odds-rank {
    align-self: center;
    margin-left: 4px;
    color: var(--color-muted);
    font-size: 11px;
    font-weight: 400;
}

/* 자동 배치 표의 td엔 max-width가 안 먹어 안쪽 span에서 자른다 */
.vr-jockey {
    display: inline-block;
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

/* 배당흐름 표는 칸이 많아 더 좁게 */
.vr-table--flow th,
.vr-table--flow td {
    padding: 0 4px;
}

.vr-table--flow th:first-child,
.vr-table--flow td:first-child {
    padding-left: 8px;
}

.vr-table--flow th:last-child,
.vr-table--flow td:last-child {
    padding-right: 8px;
}

.vr-table--flow .vr-odds-rank {
    margin-left: 1px;
}

/* 가상경기 셸 */
.vr-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;

    background: var(--vr-head-bg);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 4px;

    max-width: 100%;
}

.sports-tabs a {
    font-size: 15px;
    font-weight: 600;
}
.vr-tabs__tab {
    font-size: 14px;
    font-weight: 600;
}

.vr-meta {
    min-height: 18px;
    margin: 0 0 10px;
    color: var(--color-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
}
.vr-meta b {
    color: var(--color-black)
}
.vr-meta b.primary {
    color: var(--color-primary)
}

.vr-meta__delayed {
    margin-left: 6px;
    color: var(--vr-red);
    font-weight: 700;
}

/* 같은 줄 칸이 높이를 나눠 갖게 격자 한 장에 줄 단위로 넣는다 */
.vr-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: auto;
    align-items: stretch;
    gap: 10px;
}

/* 리그 수만큼 나란히 */
.vr-grid--one {
    grid-template-columns: minmax(0, 1fr);
}

.vr-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.vr-grid--four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.vr-video {
    min-width: 0;
    background: var(--color-surface);
    border-top: 3px solid var(--color-primary);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.vr-video--wide > * {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.vr-video__name {
    margin-top: 0;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 12px 2px;
    box-sizing: border-box;
    font-family: "Verdana", "Roboto", sans-serif;
    display: flex;
    align-items: center;
    gap: 2px;
    line-height: 15px;
}

.vr-video__screen {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    background: #000000;
}
@media (max-width: 1023px) and (orientation: landscape) and (max-height: 500px) {
    .vr-video__screen {
        max-height: calc(100dvh - 56px - 40px);
        margin: 0 auto;
    }
}

/* 영상이 뜨기 전 칸에 로고를 흐리게 */
.vr-video__screen::before,
.vr-replay-player__screen::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("/img/logo-6c4ba53b4aaf8503228a83055198a706.webp") center / 30% auto no-repeat;
    filter: grayscale(1);
    opacity: 0.35;
}

.vr-video__screen::before {
    bottom: calc(50% + 34px);
    background-position: center bottom;
}

/* 준비중 화면은 자체 아이콘이 있어서 로고를 빼둠 */
.vr-video__screen.is-started::before,
.vr-video__screen.is-empty::before {
    display: none;
}

.vr-video__play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.vr-video__play-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    font-size: 28px;
}

.vr-video__play:hover .vr-video__play-icon,
.vr-video__play:focus-visible .vr-video__play-icon {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.vr-video__empty,
.vr-replay-player__status {
    position: relative;
}

.vr-video__screen iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.vr-video__empty {
    color: #6b717c;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.vr-video__empty > .mat {
    font-size: 44px;
}
.vr-video--wide .vr-video__empty {
    font-size: 17px;
}
.vr-video--wide .vr-video__empty > .mat {
    font-size: 80px;
}
.vr-grid--two .vr-video__empty {
    font-size: 15px;
}
.vr-grid--two .vr-video__empty > .mat {
    font-size: 60px;
}
@media (max-width: 768px) {
    .vr-video--wide .vr-video__empty > .mat,
    .vr-grid--two .vr-video__empty > .mat {
        font-size: 44px;
    }
    .vr-grid--two .vr-video__empty,
    .vr-video--wide .vr-video__empty {
        font-size: 13px;
    }
}

.vr-video__providers {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 8px;
    box-sizing: border-box;
}

.vr-video__provider {
    padding: 4px 10px 3px;
    border: 1px solid var(--color-border-soft);
    border-radius: 3px;
    background: var(--color-fill);
    color: var(--color-muted);
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.vr-video__provider:hover {
    border-color: var(--color-primary);
}

.vr-video__provider.is-active {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #ffffff;
}

.vr-sec {
    min-width: 0;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
    overflow: hidden;
}

.vr-sec__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    padding: 12px 12px 8px;
}

.vr-sec__title {
    margin: 0;
    color: var(--color-primary-dark);
    font-size: 14px;
    font-weight: 700;
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: normal;
}

.vr-sec__sub {
    color: var(--color-muted);
    font-size: 12px;
    white-space: nowrap;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
}

.vr-sec__status {
    margin: 0;
    padding: 10px 8px;
    color: var(--color-muted);
}

.vr-sec__body {
    overflow-x: auto;
}

/* 표가 오기 전에 첫 줄 높이만큼 자리를 잡아 아래 칸이 밀리지 않게 */
.vr-sec--loading {
    min-height: 400px;
}

/* 긴 표는 칸 안에서 넘겨 본다 */
.vr-multi .vr-grid .vr-sec__body,
.vr-venue .vr-grid .vr-sec__body {
    max-height: 420px;
    overflow-y: auto;
}

/* 표 머리를 칸 스크롤에 붙이려면 가로 스크롤도 칸이 맡아야 한다 */
.vr-multi .vr-grid .vr-table-wrap,
.vr-venue .vr-grid .vr-table-wrap {
    overflow-x: visible;
}

.vr-multi .vr-grid .vr-table th,
.vr-venue .vr-grid .vr-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    /* 붙어 있는 동안은 border가 안 따라와서 선을 그림자로 */
    box-shadow: inset 0 -1px 0 var(--vr-row-line);
}

/* 가로로 밀어도 첫 열 이름이 보이게 */
.vr-multi .vr-grid .vr-table :is(th, td):first-child {
    position: sticky;
    left: 0;
}

.vr-multi .vr-grid .vr-table th:first-child {
    z-index: 2;
    box-shadow: inset -1px 0 0 var(--vr-freeze-line), inset 0 -1px 0 var(--vr-row-line);
}

.vr-multi .vr-grid .vr-table td:first-child {
    background: var(--color-surface);
    box-shadow: inset -1px 0 0 var(--vr-freeze-line);
}

.vr-multi .vr-grid .vr-table tr[class*="vr-tone--"] > td:first-child {
    background: inherit;
}

@media (max-width: 768px) {
    .vr-venue .vr-grid .vr-table :is(th, td):first-child {
        position: sticky;
        left: 0;
    }

    .vr-venue .vr-grid .vr-table th:first-child {
        z-index: 2;
        box-shadow: inset -1px 0 0 var(--vr-freeze-line), inset 0 -1px 0 var(--vr-row-line);
    }

    .vr-venue .vr-grid .vr-table td:first-child {
        background: var(--color-surface);
        box-shadow: inset -1px 0 0 var(--vr-freeze-line);
    }

    .vr-venue .vr-grid .vr-table tr[class*="vr-tone--"] > td:first-child {
        background: inherit;
    }
}

/* 회차 탭: 배팅·출주 아래 분류를 밑줄 탭으로 한 상자에 묶어 위계를 보인다 */
.vr-cardbar {
    margin-bottom: 12px;
    padding: 6px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-surface);
}

.vr-cardbar > .vr-tabs {
    margin: 0;
}

.vr-cardbar > .vr-tabs--line {
    margin-top: 6px;
    padding: 0 4px;
    border: 0;
    border-top: 1px solid var(--color-border);
    border-radius: 0;
    background: none;
}

.vr-tabs--line .vr-tabs__tab {
    padding: 10px 4px;
    border-radius: 0;
    border-bottom: 3px solid transparent;
}

.vr-tabs--line .vr-tabs__tab.is-active {
    border: 0;
    border-bottom: 3px solid var(--color-primary);
    background: none;
    box-shadow: none;
}

.vr-cardbar__meta {
    margin: 0 -6px -6px;
    padding: 6px 16px 8px;
    border-top: 1px solid var(--color-border);
    color: var(--color-muted);
    font-size: 12px;
}

/* 리그 화면은 칸이 좁아 표가 잘려서 두 개씩 */
@media (min-width: 769px) {
    .vr-venue > .vr-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.vr-venue .vr-grid .vr-sec--wide {
    grid-column: 1 / -1;
}

@media (min-width: 769px) {
    .vr-venue .vr-grid .vr-sec--span2 {
        grid-column: span 2;
    }
}

/* 설명 줄 선·배경은 가장 넓은 표까지 잇고 글자만 왼쪽에 붙인다 */
.vr-multi .vr-grid .vr-sec__body > *,
.vr-venue .vr-grid .vr-sec__body > * {
    width: max-content;
    min-width: 100%;
}

.vr-multi .vr-grid .vr-part__caption__text,
.vr-multi .vr-grid .vr-part__band > span,
.vr-venue .vr-grid .vr-part__caption__text,
.vr-venue .vr-grid .vr-part__band > span {
    position: sticky;
    left: 12px;
}

.vr-multi .vr-grid .vr-part__band > span,
.vr-venue .vr-grid .vr-part__band > span {
    display: inline-block;
}

/* 설명 글자 길이로 칸이 넓어지지 않게 */
.vr-multi .vr-grid .vr-part__caption,
.vr-multi .vr-grid .vr-part__band,
.vr-venue .vr-grid .vr-part__caption,
.vr-venue .vr-grid .vr-part__band {
    contain: inline-size;
}

.vr-sec__body::-webkit-scrollbar,
.vr-table-wrap::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}
.vr-sec__body::-webkit-scrollbar-track,
.vr-table-wrap::-webkit-scrollbar-track {
    background: transparent;
}
.vr-sec__body::-webkit-scrollbar-thumb,
.vr-table-wrap::-webkit-scrollbar-thumb {
    background: var(--vr-scroll-thumb);
    border-radius: 3px;
}
.vr-sec__body::-webkit-scrollbar-thumb:hover,
.vr-table-wrap::-webkit-scrollbar-thumb:hover {
    background: var(--vr-scroll-thumb-hover);
}
.vr-sec__body::-webkit-scrollbar-button,
.vr-table-wrap::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
    background-color: #FFFFFF;
}
/* 파이어폭스(Firefox) 지원 */
.vr-sec__body,
.vr-table-wrap {
    scrollbar-width: thin;
    scrollbar-color: var(--vr-scroll-thumb) transparent;
}

.vr-combined {
    margin-top: 24px;
}

/* 모바일 멀티뷰는 탭 바로 아래가 리그 통합이라 위 여백을 뺀다 */
.vr-tabs + .vr-combined,
.vr-tabs + .vr-combined > .vr-heading {
    margin-top: 0;
}

.vr-heading {
    margin: 20px 0 8px;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    padding-left: 4px;
    box-sizing: border-box;
}
.vr-heading .icon-chart {
    width: 29px;
    height: 29px;
    fill: none;
    stroke: none;
}
.icon-chart .icon-chart__frame {
    fill: none;
    stroke: var(--color-primary-dark);
    stroke-width: 2;
}
.icon-chart .icon-chart__bar {
    fill: var(--color-primary-dark);
    stroke: none;
}

.vr-heading__sub {
    margin-left: 6px;
    color: var(--color-muted);
    font-size: 12px;
    font-weight: 400;
}

.vr-venue .vr-video {
    margin-bottom: 4px;
}

.vr-blocked {
    padding: 60px 0;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    text-align: center;
}

.vr-blocked__text {
    margin: 0 0 16px;
    font-size: 16px;
}

.vr-locked {
    position: relative;
    margin-top: 8px;
    overflow: hidden;
}

.vr-bet__body > .vr-locked {
    align-self: start;
    margin-top: 0;
}

.vr-locked__sample {
    filter: blur(5px);
    user-select: none;
}

.vr-locked__veil {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 20px;
    background: color-mix(in srgb, var(--color-surface) 45%, transparent);
    text-align: center;
}

.vr-locked__text {
    margin: 0;
    color: var(--color-text);
    font-size: 16px;
    font-weight: 700;
    word-break: keep-all;
}

.vr-legend {
    margin: 4px 0 8px;
    color: var(--color-muted);
    font-size: 12px;
    font-weight: 600;
}

.vr-legend--span {
    grid-column: 1 / -1;
    margin: 0;
}

/* 가상경기 플레이 */
.vr-bet {
    margin: 4px 0 8px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
    /* hidden은 스크롤 상자가 돼서 슬립이 화면을 따라오지 못함 */
    overflow: clip;
}

.vr-bet__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-head-bg);
    font-size: 13px;
}

.vr-bet__venue {
    flex: none;
    font-weight: 700;
}

.vr-bet__match {
    min-width: 0;
    overflow: hidden;
    color: var(--color-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vr-bet__tabs {
    display: flex;
    gap: 4px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.vr-bet__tab {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 10px;
    border: 1px solid var(--color-border);
    border-radius: 15px;
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.vr-bet__tab:hover:not(.is-active) {
    border-color: var(--color-primary);
}

.vr-bet__tab.is-active {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
}

.vr-bet__count {
    font-weight: 400;
    opacity: 0.9;
}

.vr-bet__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
}

.vr-bet__market {
    min-width: 0;
    border-right: 1px solid var(--color-border);
}

.vr-bet__title {
    margin: 0;
    padding: 10px 12px 6px;
    color: var(--color-primary-dark);
    font-size: 13px;
    font-weight: 700;
}

.vr-bet__cells {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 0 12px 12px;
}

.vr-bet__cells.vr-bet__cells--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.vr-bet__cells.vr-bet__cells--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.vr-bet__cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
    min-height: 40px;
    padding: 2px 10px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-fill);
    color: var(--color-text);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.vr-bet__cell:hover:not(:disabled) {
    border-color: var(--color-primary);
}

.vr-bet__cell.is-picked {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
}

.vr-bet__cell:disabled {
    color: var(--color-scheduled);
    cursor: not-allowed;
}

.vr-bet__name {
    text-align: left;
    min-width: 0;
    overflow-wrap: anywhere;
}
@media (min-width: 1024px) and (max-width: 1279px) {
    .vr-bet__cells {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


.vr-bet__odds {
    color: var(--color-primary-dark);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.vr-bet__cell.is-picked .vr-bet__odds {
    color: inherit;
}

.vr-bet__cell:disabled .vr-bet__odds {
    color: inherit;
}

.vr-bet__slip {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding-bottom: 12px;
    /* 따라다니면 높이가 달라져서 양쪽 선을 겹쳐 긴 쪽 선이 보이게 */
    margin-left: -1px;
    border-left: 1px solid var(--color-border);
    position: sticky;
    top: 16px;
    align-self: start;
    scroll-margin-top: 12px;
}

.vr-bet__slip > :not(.vr-bet__title) {
    margin-left: 12px;
    margin-right: 12px;
}

.vr-bet__empty {
    margin: 0;
    padding: 12px;
    color: var(--color-muted);
    font-size: 13px;
    text-align: center;
}

.vr-bet__pick {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--color-primary-soft);
    font-size: 13px;
}

.vr-bet__pick-race {
    color: var(--color-muted);
    font-size: 12px;
}

.vr-bet__pick-line {
    display: flex;
    justify-content: space-between;
    gap: 6px;
}

.vr-bet__amount {
    display: flex;
    gap: 6px;
}

.vr-bet__input {
    flex: 1;
    min-width: 0;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
    text-align: right;
}

.vr-bet__steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
}

.vr-bet__steps .btn {
    height: 32px;
    padding: 0;
    font-size: 12px;
}

.vr-bet__rows {
    margin: 0;
    font-size: 13px;
}

.vr-bet__rows div {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
}

.vr-bet__rows dt {
    color: var(--color-muted);
}

.vr-bet__rows dd {
    margin: 0;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.vr-bet__win {
    color: var(--color-primary-dark);
}

.vr-bet__alert {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 0;
    margin-bottom: 0;
    padding: 8px 10px;
    border: 1px solid var(--color-error);
    border-radius: 8px;
    background: var(--color-error-soft);
    color: var(--color-error);
    font-size: 13px;
    font-weight: 700;
}

.vr-bet__alert.is-success {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
    color: var(--color-primary-dark);
}

.vr-bet__actions {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 6px;
}

.vr-bet__actions .btn:disabled {
    opacity: 0.6;
    cursor: default;
}

@media (max-width: 1023px) {
    .vr-bet__head {
        flex-wrap: wrap;
        gap: 6px;
    }

    .vr-bet__tabs {
        flex-basis: 100%;
    }

    .vr-bet__body {
        grid-template-columns: minmax(0, 1fr);
    }

    .vr-bet__market {
        border-right: 0;
    }

    .vr-bet__slip {
        position: static;
        margin-left: 0;
        border-left: 0;
        border-top: 1px solid var(--color-border);
    }

    .vr-bet__cells {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* 가상경기 다시보기 */
.vr-replay__search {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
}

.vr-replay__field {
    display: flex;
    align-items: center;
    gap: 6px;
}

.vr-replay__label {
    color: var(--vr-text-sub);
    font-size: 12px;
    font-weight: 700;
}

.vr-replay__number {
    width: 72px;
}

.vr-replay__tilde {
    color: var(--color-muted);
}

.vr-replay__status {
    margin: 0;
}

.coupon-intro {
    margin: 0 0 16px;
    color: var(--color-muted);
}

.vr-replay__retry {
    margin-left: 8px;
}

.vr-replay__table {
    font-size: 13px;
}

.vr-replay__table th,
.vr-replay__table td {
    height: 36px;
}

.vr-replay__time {
    font-variant-numeric: tabular-nums;
}

.vr-replay__table .vr-replay__play-cell {
    width: 1%;
    text-align: center;
}

/* 표를 밀지 않아도 재생 버튼이 보이게 오른쪽에 붙여 둔다 */
.vr-replay__table .vr-replay__play-cell {
    position: sticky;
    right: 0;
    background: var(--color-surface);
    box-shadow: -1px 0 0 var(--vr-row-line);
}

.vr-replay__table .vr-replay__narrow {
    display: none;
}

/* 농구는 칸이 많아 팀 이름이 들어가는 칸만 줄바꿈 허용, 팀 칸은 홈·원정 두 줄 */
.vr-replay__table td.vr-replay__wide {
    padding-top: 4px;
    padding-bottom: 4px;
}

.vr-replay__table td.vr-replay__wide:nth-child(3) {
    white-space: pre;
}

.vr-replay__table td.vr-replay__wide:is(:nth-child(4), :nth-child(5), :nth-child(8)) {
    white-space: normal;
}

.vr-replay__table th.vr-replay__play-cell {
    background: var(--vr-head-bg);
}

.vr-replay__play {
    width: 32px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--color-primary);
    border-radius: 3px;
    background: var(--color-primary-soft);
    color: var(--color-primary-dark);
    font-size: 12px;
    cursor: pointer;
}

.vr-replay__play:hover {
    background: var(--color-primary);
    color: #ffffff;
}

.vr-replay__play:focus-visible {
    outline: 2px solid var(--vr-line);
    outline-offset: 2px;
}

.vr-replay__gap {
    min-width: 32px;
    padding: 6px 4px;
    color: var(--color-muted);
    text-align: center;
}

/* 테두리·여백이 있으면 그곳을 눌러도 바깥 클릭이 돼서 상자 꾸밈은 안쪽 div에 둔다 */
.vr-replay-player {
    width: 960px;
    padding: 0;
    border: 0;
    background: transparent;
}

.vr-replay-player::backdrop {
    background: rgba(0, 0, 0, 0.6);
}

.vr-replay-player__box {
    padding: 8px 10px 10px;
    border-top: 2px solid var(--color-primary);
    background: #1d2a3a;
    color: #ffffff;
}

.vr-replay-player__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.vr-replay-player__title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}

.vr-replay-player__close {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #3d4d61;
    border-radius: 3px;
    background: transparent;
    color: #c8d2de;
    font-size: 14px;
    cursor: pointer;
}

.vr-replay-player__close:hover {
    border-color: var(--color-primary);
    color: #ffffff;
}

.vr-replay-player__screen {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    background: #000000;
}

.vr-replay-player__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000000;
}

.vr-replay-player__status {
    margin: 14% 0 0;
    color: #c8d2de;
    font-size: 13px;
    text-align: center;
}

.vr-replay-player__message {
    margin: 0 0 10px;
}

.vr-replay-player__placings {
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 8px 2px 0;
    list-style: none;
    font-size: 13px;
}

.vr-replay-player__rank {
    margin-right: 4px;
    color: #8fa3b8;
    font-weight: 700;
}

.vr-bet__slip > .vr-bet__slip-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding-right: 12px;
}

.vr-bet__history {
    height: 26px;
    margin-top: 4px;
    padding: 0 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.vr-bet__history:hover {
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
}

/* 다시보기 창처럼 상자 꾸밈은 안쪽 div에 둬서 바깥 클릭만 닫히게 */
.vr-bet-history {
    width: 860px;
    max-width: calc(100vw - 32px);
    padding: 0;
    border: 0;
    background: transparent;
}

.vr-bet-history::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

.vr-bet-history__box {
    padding: 12px 16px 16px;
    border-top: 2px solid var(--color-primary);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-text);
}

.vr-bet-history__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.vr-bet-history__title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.vr-bet-history__close {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: transparent;
    color: var(--color-muted);
    font-size: 14px;
    cursor: pointer;
}

.vr-bet-history__close:hover {
    border-color: var(--color-primary);
    color: var(--color-text);
}

@media (max-width: 1023px) {
    .vr-bet-history {
        width: 100vw;
        max-width: none;
        height: 100dvh;
        max-height: none;
        margin: 0;
    }

    .vr-bet-history__box {
        min-height: 100%;
        border-radius: 0;
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
}

/* 멀티뷰 리그 칸에 구간이 다 들어가게 이 표만 여백을 줄임 */
.vr-table.vr-table--odds-sum th,
.vr-table.vr-table--odds-sum td {
    padding-left: 6px;
    padding-right: 6px;
}

/* 가상경기 결과 */
.vr-result__row {
    cursor: pointer;
}

.vr-result__caret {
    display: inline-block;
    width: 1em;
    color: var(--color-muted);
}

.vr-result__row:hover td,
.vr-result__row.is-open td {
    background: var(--vr-blue-soft);
}

.vr-result__row:focus-visible {
    outline: 2px solid var(--vr-line);
    outline-offset: -2px;
}

.vr-result__odds {
    margin-left: 6px;
    color: var(--color-muted);
    font-variant-numeric: tabular-nums;
}

/* 펼친 칸은 줄바꿈을 허용해 배당이 많은 마켓도 표 너비 안에 둔다 */
.vr-table td.vr-result__detail {
    height: auto;
    padding: 10px 12px;
    background: var(--vr-head-bg);
    white-space: normal;
}

.vr-result__market {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 16px;
    padding: 3px 0;
}

.vr-result__market-name {
    width: 120px;
    color: var(--vr-text-sub);
    font-weight: 700;
}

.vr-result__pick b {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.vr-result__pick em {
    align-self: center;
    margin-left: 4px;
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--vr-blue);
    color: #ffffff;
    font-size: 11px;
    font-style: normal;
}

.vr-result__results {
    display: grid;
    grid-template-columns: 220px 1fr 220px 1fr;
    gap: 4px 12px;
    margin: 8px 0 0;
    padding-top: 8px;
    border-top: 1px solid var(--color-border);
}

.vr-result__results dt {
    color: var(--vr-text-sub);
    font-weight: 700;
}

.vr-result__results dd {
    margin: 0;
}

/* 다음 경기 분석 */
.vr-next {
    margin-bottom: 16px;
}

.vr-multi .vr-grid + .vr-next {
    margin-top: 10px;
}

.vr-venue .vr-video + .vr-next {
    margin-top: 4px;
}

.vr-next .vr-tabs {
    flex-wrap: wrap;
    margin: 8px 8px 12px;
}

button.vr-tabs__tab {
    font-family: inherit;
    cursor: pointer;
}

.vr-next .vr-tabs__tab.is-idle {
    opacity: 0.5;
}

.vr-next__body {
    padding: 0 8px 8px;
}

.vr-next__game {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 700;
}

.vr-next__win {
    color: var(--vr-green);
}

.vr-next__draw {
    color: var(--vr-orange);
}

.vr-next__loss {
    color: var(--vr-red);
    font-weight: 700;
}

/* 맞대결 표는 팀 이름 칸이 셋이라 한 줄 전체를 씀 */
.vr-next .vr-grid > .vr-part:last-child {
    grid-column: 1 / -1;
}

/* 여기는 스크롤 맡을 칸 본문이 없어 표가 직접 넘긴다 */
.vr-venue .vr-next .vr-grid .vr-table-wrap {
    overflow-x: auto;
}

@media (max-width: 768px) {
    /* 긴 팀 이름 때문에 스코어·승자가 밀려나지 않게 */
    .vr-next .vr-next__team {
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

.coupon-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.coupon-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 16px;
}

.coupon-card > :not(.coupon-image-link) {
    margin-inline: 16px;
}

.coupon-image-link {
    display: block;
}

.coupon-image {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: 12px;
    background: var(--color-bg);
    object-fit: cover;
}

.coupon-vendor {
    margin-block: 0;
    color: var(--color-muted);
    font-size: 12px;
}

/* 이름 길이가 달라도 가격·버튼 줄이 맞도록 두 줄 높이 고정 */
.coupon-name {
    display: -webkit-box;
    min-height: 2.8em;
    margin-block: 2px 0;
    overflow: hidden;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    word-break: keep-all;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.coupon-price {
    margin-block: 6px 0;
    color: var(--color-primary-dark);
    font-size: 16px;
    font-weight: 700;
}

.coupon-sms-note {
    margin-block: 4px 0;
    color: var(--color-muted);
    font-size: 12px;
}

.coupon-action {
    margin-top: auto;
    padding-top: 12px;
}

.coupon-action .btn {
    width: 100%;
}

.coupon-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 13px;
    background: var(--color-bg);
    color: var(--color-muted);
    text-align: center;
}

.coupon-detail-top {
    display: flex;
    gap: 24px;
    padding: 24px;
}

.coupon-detail-image {
    display: block;
    flex: none;
    align-self: flex-start;
    width: 160px;
    aspect-ratio: 1;
    border-radius: 8px;
    background: var(--color-bg);
    object-fit: cover;
}

.coupon-detail-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.coupon-detail-name {
    margin: 4px 0 0;
    font-size: 22px;
    line-height: 1.4;
    word-break: keep-all;
}

.coupon-detail-info .coupon-price {
    margin-top: 8px;
    font-size: 20px;
}

.coupon-detail-info .coupon-action {
    max-width: 320px;
}

.coupon-detail-body {
    max-width: 860px;
    margin: 24px auto 0;
}

.coupon-detail-description {
    margin: 0 0 16px;
    line-height: 1.7;
    white-space: pre-line;
}

.coupon-detail-img {
    display: block;
    width: 100%;
    height: auto;
}

.coupon-dialog {
    width: 400px;
    max-width: calc(100% - 32px);
    padding: 20px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
}

.coupon-dialog::backdrop {
    background: rgba(0, 0, 0, 0.35);
}

.coupon-dialog h2 {
    margin: 0 0 12px;
    font-size: 16px;
}

.coupon-dialog p {
    margin: 0 0 8px;
    line-height: 1.5;
    word-break: keep-all;
}

/* .btn·모바일 .page .btn의 display가 hidden을 덮어서 한 단계 더 세게 */
.coupon-dialog [hidden],
.coupon-dialog .btn[hidden] {
    display: none;
}

.coupon-code-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
}

.coupon-dialog .coupon-code {
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    font-family: Consolas, "Courier New", monospace;
    font-size: 16px;
    letter-spacing: 1px;
}

.coupon-dialog .coupon-copy-status,
.coupon-result-note {
    color: var(--color-muted);
    font-size: 12px;
}

.coupon-result-note {
    margin-top: 12px;
}

.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

/* 내용이 짧아도 푸터가 화면 바닥에 붙게 */
.site-body {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    grid-template-rows: auto 1fr;
    column-gap: 24px;
    align-items: start;
    padding-top: 24px;
    padding-bottom: 40px;
}

/* 페이지 main이 달고 오는 여백을 지우고 위아래는 바깥 틀에 맞춤 */
.site-body > main {
    grid-row: 1 / span 2;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 0;
}

.side {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 사이드 폭이 좁아 공식 방 탭은 제목 아래 줄을 통째로 씀 */
.chat-dock .chat-head {
    flex-wrap: wrap;
    row-gap: 10px;
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
}

.chat-dock .chat-tabs {
    flex: 1 0 100%;
    min-height: 36px;
}

.chat-dock {
    position: sticky;
    top: 16px;
}

.side-profile {
    padding: 20px;
}

.side-profile-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
}

.side-profile-head .rank-badge--label {
    padding: 2px 8px 2px 4px;
    border-radius: 999px;
    background: var(--color-primary-soft);
    font-size: 12px;
}

.side-points {
    display: flex;
    margin: 12px 0 16px;
    padding: 10px 0;
    border-radius: 10px;
    background: var(--color-fill);
    border: 1px solid var(--color-border);
}

.side-points > div {
    flex: 1;
    padding: 0 14px;
}

.side-points > div + div {
    border-left: 1px solid var(--color-border);
}

.side-points dt {
    color: var(--color-muted);
    font-size: 12px;
}

.side-points dd {
    margin: 2px 0 0;
    color: var(--color-text);
    font-size: 16px;
    font-weight: 700;
}

.side-points .member-points {
    color: var(--color-primary-dark);
}

.side-points .is-zero {
    color: var(--color-muted);
}

.side-rank {
    margin-bottom: 16px;
}

.side-rank-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px;
    color: var(--color-muted);
    font-size: 12px;
}

.side-rank-head strong {
    color: var(--color-text);
}

.side-rank-head em {
    margin-left: auto;
    font-style: normal;
}

.side-rank .progress {
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.side-rank-next {
    margin: 6px 0 0;
    color: var(--color-muted);
    font-size: 11px;
}

.side-quick {
    display: flex;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.side-quick a {
    position: relative;
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.side-quick a:hover {
    text-decoration: none;
}

/* 여섯 개면 한 줄에 글자가 눌려서 세 개씩 두 줄 */
.side-quick:has(> a:nth-child(6)) {
    flex-wrap: wrap;
    row-gap: 14px;
}

.side-quick:has(> a:nth-child(6)) a {
    flex: 0 0 33.333%;
}

.side-quick svg {
    box-sizing: content-box;
    width: 22px;
    height: 22px;
    padding: 10px;
    border-radius: 50%;
    background: var(--color-primary-soft);
    color: var(--color-primary-dark);
}

.side-quick em {
    position: absolute;
    top: -4px;
    left: calc(50% + 8px);
}

/* 아이콘 위 배지라 읽지 않은 게 있을 때만 띄움 */
.side-quick .message-count:not(.is-unread) {
    display: none;
}

.side-quick svg,
.tabbar svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.drawer-head,
.side .gnb,
.side-logout,
.header-points,
.chat-dock-close,
.layout-backdrop,
.board-sheet,
.tabbar,
.to-top {
    display: none;
}

.site-body:has(> main.page--plain) {
    grid-template-columns: minmax(0, 1fr);
}

.site-body:has(> main.page--plain) > .chat-dock,
body:has(main.page--plain) .tabbar-chat {
    display: none;
}

.chat-dock .chat-alerts {
    color: var(--color-text);
    text-shadow: none;
}

@media (min-width: 1024px) {
    .site-body:has(> main.page--plain) > .side {
        display: none;
    }

    /* 비회원은 프로필이 없어 채팅이 본문과 같은 줄에서 시작하게 간격을 프로필 쪽에 둠 */
    .side-profile {
        margin-bottom: 12px;
    }

    /* 화면 높이만큼 채우되 낮은 노트북에선 입력창이 밀리지 않게, 긴 모니터에선 너무 길지 않게 */
    .chat-dock .chat {
        display: flex;
        flex-direction: column;
        /* --chat-top은 chat.js가 잰 박스 시작 위치, 맨 위에서도 끌 손잡이가 화면 안에 남게 */
        height: clamp(480px, calc(100vh - var(--chat-top, 16px) - 16px), 860px);
        min-height: 360px;
        max-height: calc(100vh - var(--chat-top, 16px) - 16px);
        overflow: hidden;
        resize: vertical;
    }

    .chat-dock .chat-list,
    .chat-dock .chat-panel {
        flex: 1;
        height: auto;
        min-height: 0;
    }
}

@media (max-width: 1023px) {
    /* 하단 탭 자리를 푸터가 채워서 푸터 아래 회색 띠가 안 보이게 */
    .site-footer {
        padding-bottom: calc(88px + env(safe-area-inset-bottom));
    }

    /* 아이폰 가로 모드에서 노치 밑으로 들어가지 않게 */
    .inner {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }

    .header-top {
        height: 56px;
        gap: 12px;
    }

    .logo img {
        height: 32px;
    }

    .header-top > .gnb,
    .member-menu--in > :not(.header-points) {
        display: none;
    }

    .member-menu .btn-signup,
    .member-menu .btn-login {
        position: relative;
        height: 30px;
        padding: 0 10px;
        font-size: 12px;
    }

    /* 헤더 높이는 그대로 두고 누르는 범위만 위아래로 넓힘 */
    .member-menu .btn-signup::after,
    .member-menu .btn-login::after {
        content: "";
        position: absolute;
        inset: -7px 0;
    }

    .header-nick {
        max-width: 120px;
        overflow: hidden;
        color: var(--color-text);
        font-size: 12px;
        font-weight: 600;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .header-points {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 4px 10px;
        border-radius: 999px;
        background: var(--color-primary-soft);
        color: var(--color-primary-dark);
        font-weight: 700;
    }

    .site-body {
        display: block;
    }

    /* shortcut: 본문 화면별 모바일 처리 전까지 넘치는 표는 가로 스크롤, 본문 작업 때 걷어냄 */
    /* 본문 전체가 스크롤 상자면 아이폰에서 세로 스크롤을 가끔 가로채서 표 있는 화면만 */
    .site-body > main:has(.board-table) {
        overflow-x: auto;
    }

    .board-table {
        min-width: 640px;
    }

    /* display:none이 아니라 transform으로 숨겨야 채팅 탭 폭 계산이 살아 있음 */
    .side,
    .chat-dock {
        position: fixed;
        z-index: 60;
        background: var(--color-surface);
        visibility: hidden;
        transition: transform 0.2s, visibility 0.2s;
    }

    .side {
        top: 0;
        right: 0;
        bottom: 0;
        width: min(320px, 88vw);
        gap: 0;
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
        overflow-y: auto;
        transform: translateX(100%);
    }

    .chat-dock {
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        /* 입력칸이 아이폰 홈 막대에 가리지 않게 */
        padding-bottom: env(safe-area-inset-bottom);
        height: 85vh;
        height: 85dvh;
        margin: 0;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
    }

    .chat-dock::before {
        content: "";
        position: absolute;
        top: 6px;
        left: 50%;
        z-index: 1;
        width: 40px;
        height: 4px;
        margin-left: -20px;
        border-radius: 2px;
        background: #d1d5db;
    }

    body.is-drawer-open .side,
    body.is-chat-open .chat-dock,
    body.is-boards-open .board-sheet {
        visibility: visible;
        transform: none;
    }

    body.is-drawer-open,
    body.is-chat-open,
    body.is-boards-open {
        overflow: hidden;
    }

    body.is-drawer-open .layout-backdrop,
    body.is-chat-open .layout-backdrop,
    body.is-boards-open .layout-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 50;
        background: rgba(0, 0, 0, 0.4);
    }

    /* 회원 드로어는 내용이 넘쳐서 flex가 머리 높이를 눌러 버림 */
    .drawer-head {
        display: flex;
        flex: none;
        align-items: center;
        justify-content: space-between;
        height: 56px;
        padding: 0 16px;
        font-size: 16px;
        position: sticky;
        top: 0;
        background: var(--color-surface);
        z-index: 1;
    }

    .drawer-close,
    .chat-dock-close {
        width: 44px;
        height: 44px;
        border: 0;
        background: none;
        font-size: 20px;
        cursor: pointer;
    }

    .drawer-close {
        margin-right: -12px;
    }

    .side .side-profile {
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .side-logout {
        display: block;
        margin-top: 12px;
        text-align: center;
    }

    .side .gnb {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .side .gnb > a,
    .side .gnb-item > a {
        padding: 14px 16px;
        border-top: 1px solid var(--color-border);
        font-weight: 700;
    }

    .side .gnb-sub {
        display: block;
        position: static;
        min-width: 0;
        padding: 0 0 8px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: var(--color-bg);
    }

    .side .gnb-sub a {
        padding: 10px 28px;
    }

    .side .gnb-item > a[aria-expanded]::after {
        content: "▾";
        float: right;
        color: var(--color-muted);
        transition: transform 0.2s;
    }

    .side .gnb-item > a[aria-expanded="true"]::after {
        transform: rotate(180deg);
    }

    .side .gnb-item > a[aria-expanded="false"] + .gnb-sub {
        display: none;
    }

    .side .gnb-sub .gnb-league {
        display: none;
    }

    .side .gnb-sport {
        display: block;
        padding: 0;
        border: 0;
    }

    .side .gnb-sport > a:first-child {
        margin: 0;
        color: var(--color-muted);
        font-weight: 400;
    }

    .side .gnb-sub a::before {
        content: "";
        display: inline-block;
        width: 5px;
        height: 5px;
        margin-right: 8px;
        border-radius: 50%;
        background: var(--color-primary);
        vertical-align: middle;
    }

    .chat-dock-close {
        display: block;
        position: absolute;
        top: 6px;
        right: 4px;
        z-index: 1;
    }

    .chat-dock .chat {
        display: flex;
        flex-direction: column;
        height: 100%;
        border: 0;
    }

    .chat-dock .chat-list,
    .chat-dock .chat-panel {
        flex: 1;
        height: auto;
        min-height: 0;
    }

    /* 모바일 새 창은 탭으로 열려 소켓만 옮겨 가므로 막음 */
    .chat-dock .chat-popup-btn {
        display: none;
    }

    /* 키보드가 뜨면 시트가 좁아져 알림 줄은 뺌 */
    body.is-kb-open .chat-dock .chat-alerts {
        display: none;
    }

    .board-sheet {
        display: block;
        visibility: hidden;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 60;
        max-height: 70dvh;
        overflow-y: auto;
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
        border-radius: 16px 16px 0 0;
        background: var(--color-surface);
        transform: translateY(100%);
        transition: transform 0.2s ease, visibility 0.2s;
    }

    .board-sheet a {
        display: flex;
        align-items: center;
        min-height: 48px;
        padding: 0 20px;
        border-top: 1px solid var(--color-line-soft);
        color: var(--color-text);
        font-size: 15px;
    }

    .board-sheet a:hover {
        text-decoration: none;
        background: var(--color-head-bg);
    }

    .to-top.is-shown {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        right: calc(12px + env(safe-area-inset-right));
        bottom: calc(68px + env(safe-area-inset-bottom));
        z-index: 39;
        width: 40px;
        height: 40px;
        padding: 0;
        border: 1px solid var(--color-border);
        border-radius: 50%;
        background: var(--color-surface);
        color: var(--color-text);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        cursor: pointer;
    }

    .to-top svg {
        width: 20px;
        height: 20px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
    }

    /* 시트가 열려 있으면 그 위로 비치지 않게 */
    body.is-drawer-open .to-top,
    body.is-chat-open .to-top,
    body.is-boards-open .to-top {
        display: none;
    }

    .tabbar {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 40;
        height: calc(56px + env(safe-area-inset-bottom));
        padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
        border-top: 1px solid var(--color-border);
        background: var(--color-surface);
        /* 사파리 주소창 접힐 때 탭바 아래 틈 가림 */
        box-shadow: 0 100px 0 var(--color-surface);
    }

    .tabbar > * {
        display: flex;
        flex: 1;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: var(--color-muted);
        font-size: 11px;
    }

    .tabbar > :hover {
        text-decoration: none;
    }

    .tabbar button {
        padding: 0;
        border: 0;
        background: none;
        font: inherit;
        font-size: 11px;
        cursor: pointer;
    }

    /* 지금 있는 탭 표시와 헷갈리지 않게 색 대신 솟은 원 버튼으로 강조 */
    .tabbar .tabbar-chat {
        position: relative;
        justify-content: flex-end;
        padding-bottom: 6px;
        color: var(--color-primary-dark);
        font-weight: 700;
    }

    .tabbar .tabbar-chat svg {
        width: 46px;
        height: 46px;
        margin-top: -22px;
        padding: 9px;
        border: 3px solid var(--color-surface);
        border-radius: 50%;
        background: var(--color-primary);
        color: #fff;
        box-shadow: 0 2px 8px rgba(0, 160, 74, 0.35);
    }

    /* 채팅 안에 확인할 알림이 있을 때만 원 옆 깜빡이는 점을 켬 */
    .tabbar-chat.has-alert::before,
    .tabbar-chat.has-alert::after {
        content: "";
        position: absolute;
        top: -18px;
        left: calc(50% + 12px);
        width: 12px;
        height: 12px;
        border: 2px solid var(--color-surface);
        border-radius: 50%;
        background: var(--color-live);
    }

    .tabbar-chat.has-alert::after {
        border-color: transparent;
        animation: chat-pulse 2.4s ease-out infinite;
    }

    @media (prefers-reduced-motion: reduce) {
        .tabbar-chat.has-alert::after {
            animation: none;
            opacity: 0;
        }
    }

    .tabbar svg {
        width: 22px;
        height: 22px;
    }

    .tabbar > .active {
        color: var(--color-primary-dark);
        font-weight: 700;
    }

    .footer-grid,
    .footer-links {
        flex-direction: column;
        gap: 16px;
    }
}

/* 가로로 돌리면 영상 보면서 채팅하게 오른쪽 반투명 패널로 */
@media (max-width: 1023px) and (orientation: landscape) and (max-height: 500px) {
    .chat-dock .chat-emoji-pop emoji-picker {
        --emoji-padding: 0.14rem;
        color: var(--color-text);
    }

    .chat-total .count {
        color: #FFFFFF;
        margin: 0 4px;
    }
    .chat--popup .chat-total .count {
        color: #000000;
        margin: 0 4px;
    }
    :root[data-theme="dark"] .chat--popup .chat-total .count {
        color: #FFFFFF;
    }

    .chat-dock .chat-total {
        opacity: 0.8;
    }

    .chat-dock {
        top: 0;
        bottom: 0;
        left: auto;
        width: 40%;
        height: auto;
        padding-right: env(safe-area-inset-right);
        border-radius: 0;
        background: rgba(15, 23, 42, 0.7);
        color: #fff;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .chat-dock::before,
    body.is-chat-open .tabbar,
    body.is-chat-open .layout-backdrop {
        display: none;
    }

    /* 아이폰 가로는 키보드가 뜨면 100px 남짓만 보여서 입력줄만 남김 */
    body.is-kb-open .chat-dock-close,
    body.is-kb-open .chat-dock .chat-head,
    body.is-kb-open .chat-dock .chat-alerts {
        display: none;
    }

    body.is-chat-open {
        overflow: auto;
    }

    .chat-dock .chat,
    .chat-dock .chat-head,
    .chat-dock .chat-panel,
    .chat-dock .chat-list li,
    .chat-dock .chat-list li:where(:not(.chat-empty)):hover {
        border-color: rgba(255, 255, 255, 0.15);
        background: transparent;
    }

    .chat-dock .chat-friend-list li:hover {
        background: transparent;
    }

    .chat-dock .chat-list li.mine,
    .chat-dock .chat-list li.chat-admin-notice {
        background: rgba(255, 255, 255, 0.12);
    }

    .chat-dock-close,
    .chat-dock .chat-head .chat-menu-btn,
    .chat-dock .chat-list li:not(.chat-randombox-row):not(.chat-empty) .chat-msg-text:not(.chat-bubble):not(.chat-hidden) {
        color: #fff;
    }

    .chat-dock .chat-list li:not(.chat-randombox-row):not(.chat-empty) .chat-msg-nick,
    .chat-dock .chat-list li:not(.chat-randombox-row):not(.chat-empty):not(.mine):not(.chat-admin-notice) .chat-msg-nick,
    .chat-dock .chat-list li.chat-admin-notice .chat-msg-nick,
    .chat-dock .chat-admin-icon {
        color: #86efac;
    }

    .chat-dock .chat-list li:not(.chat-empty) .chat-msg-time,
    .chat-dock .chat-list li.chat-room-event {
        color: rgba(255, 255, 255, 0.75);
    }

    .chat-dock .chat-list li.chat-admin-notice .chat-msg-time {
        color: rgba(255, 255, 255, 0.95);
    }

    .chat-dock .chat-list li.chat-admin-notice:not(.chat-empty) .chat-msg-nick {
        color: #e3fcec;
    }

    /* 이병 같은 어두운 계급장이 배경에 묻혀서 테두리를 밝게 */
    .chat-dock .chat-rank-icon {
        filter: drop-shadow(0 0 1px #fff);
    }

    .chat-dock .chat-tabs {
        background: rgba(255, 255, 255, 0.12);
    }

    .chat-dock .chat-tabs a,
    .chat-dock .chat-tabs em {
        color: rgba(255, 255, 255, 0.9);
    }

    .chat-dock .chat-tabs a.active {
        background: rgba(255, 255, 255, 0.92);
        color: var(--color-text-fixed);
        text-shadow: none;
    }

    .chat-dock .chat-tabs a.active em {
        color: #646a73;
    }
    .chat-dock .chat-tabs a.active em .count {
        color: var(--color-text-fixed);
    }

    .chat-dock .chat-input {
        border-color: rgba(255, 255, 255, 0.15);
    }

    .chat-dock .chat-input-bar,
    .chat-dock .chat-input-bar:focus-within {
        border-color: rgba(255, 255, 255, 0.3);
        background: rgba(255, 255, 255, 0.14);
        box-shadow: none;
    }

    .chat-dock .chat-input-bar:focus-within {
        border-color: rgba(255, 255, 255, 0.7);
    }

    /* 폭이 768px을 넘어 아래 16px 규칙이 안 걸리는데 작으면 iOS가 확대함 */
    .chat-dock .chat .chat-input input,
    .chat-dock .chat .chat-input input:focus {
        color: #fff;
        font-size: 16px;
    }

    .chat-dock .chat-input input::placeholder {
        color: #fff;
    }

    .chat-dock .chat-emoji-btn,
    .chat-dock .chat-bubble-btn {
        color: #fff;
    }

    .chat-dock .chat-emoji-pop,
    .chat-dock .chat-bubble-pop {
        text-shadow: none;
    }

    .chat-dock .chat-profile-note.error {
        padding: 4px 8px;
        border-radius: 6px;
        background: var(--color-error-soft);
        color: var(--color-error);
        text-shadow: none;
    }

    .chat-dock .chat-profile-posts time {
        color: rgba(255, 255, 255, 0.75);
    }

    .chat-dock .chat-btn--danger {
        color: #ffc8c8;
    }

    .chat-dock .chat-btn--danger:hover:not(:disabled) {
        background: transparent;
        color: #ffc8c8;
    }

    .chat-dock .chat-profile-rank {
        color: #86efac;
    }

    .chat-dock .chat-list .chat-hidden,
    .chat-dock .chat-field-label small,
    .chat-dock .chat-randombox-summary,
    .chat-dock .chat-room-list .chat-empty,
    .chat-dock .chat-friend-list .chat-empty,
    .chat-dock .chat-friend-rank,
    .chat-dock .chat-room-bar em,
    .chat-dock .chat-list .chat-empty,
    .chat-dock .chat-profile-posts .chat-empty,
    .chat-dock .chat-randombox-winners .chat-empty {
        color: rgba(255, 255, 255, 0.75);
    }

    .chat-dock .chat-randombox-won,
    .chat-dock .chat-panel .chat-error,
    .chat-dock .chat-form-danger span {
        color: #ffc8c8;
    }

    .chat-dock .chat-room-bar .chat-btn--ghost,
    .chat-dock .chat-room-bar .chat-icon-btn,
    .chat-dock .chat-panel-head .chat-icon-btn {
        color: #fff;
    }

    .chat-dock .chat-room-bar .chat-icon-btn:hover:not(:disabled),
    .chat-dock .chat-panel-head .chat-icon-btn:hover:not(:disabled) {
        background: rgba(255, 255, 255, 0.12);
    }

    .chat-dock .chat-profile-info dd {
        color: var(--color-text);
        text-shadow: none;
    }

    .chat-dock .chat-menu {
        color: var(--color-text);
        text-shadow: none;
    }
}

@media (max-width: 768px) {
    /* 채팅 입력도 16px 미만이면 iOS가 확대함 */
    .chat :is(input[type], textarea),
    .chat .chat-input input:focus {
        font-size: 16px;
    }

    .chat-form input {
        min-height: 40px;
    }

    .chat-form .chat-btn {
        min-height: 40px;
        padding: 0 16px;
    }

    /* iOS는 16px보다 작은 입력에 초점이 가면 화면을 확대함 */
    .page :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]), select, textarea):not(.chat *) {
        font-size: 16px;
    }

    /* 확대는 입력 글자 크기로만 정해져서 안내 문구는 주변 글씨에 맞춤 */
    .page :is(input, textarea):not(.chat *)::placeholder {
        font-size: 14px;
    }

    .page :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]), select):not(.chat *) {
        height: 44px;
    }

    .page .btn,
    .view-toggle a,
    .sports-tabs a,
    .vr-tabs__tab,
    .activity-tabs a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
    }

    .view-toggle,
    .sports-tabs,
    .vr-tabs,
    .activity-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .view-toggle::-webkit-scrollbar,
    .sports-tabs::-webkit-scrollbar,
    .vr-tabs::-webkit-scrollbar,
    .activity-tabs::-webkit-scrollbar {
        display: none;
    }

    .view-toggle > *,
    .sports-tabs > *,
    .vr-tabs > *,
    .activity-tabs > * {
        flex-shrink: 0;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .pagination a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 40px;
        min-height: 44px;
        padding: 0 8px;
    }

    /* 큰 터치 칸으로 10개면 두 줄이 돼서 모바일은 5개씩 */
    .pagination .page-pc,
    .pagination .page-far {
        display: none;
    }

    .pagination .page-mobile {
        display: inline-flex;
    }

    .page-head {
        gap: 12px;
    }

    .search-bar {
        display: grid;
        grid-template-columns: 1fr auto;
    }

    .search-bar input {
        min-width: 0;
    }

    .search-bar .view-toggle {
        grid-column: 1 / -1;
        justify-self: end;
        margin-left: 0;
    }

    /* 표는 화면 폭에 맞추고 좁은 칸은 단어 단위로 줄바꿈 */
    .board-table {
        min-width: 0;
        font-size: 13px;
    }

    .board-table th,
    .board-table td {
        padding: 6px;
        white-space: normal;
        word-break: keep-all;
    }

    .board-table .title {
        white-space: nowrap;
    }

    .board-table .col-author {
        width: 72px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .board-table .col-date { width: 84px; font-size: 12px; }
    .message-table .col-date { width: 108px; }
    .board-table .col-view { width: 44px; }
    .board-table .col-state { width: 56px; }
    .board-table .col-manage { width: 108px; }
    .activity-table .col-board { width: 64px; white-space: nowrap; }
    .activity-table .col-rank { width: 48px; }
    /* 쿠폰 행은 세 줄 카드로: 상품·상태 / 일련번호 / 기한·사이트 */
    .coupon-table,
    .coupon-table tbody {
        display: block;
    }

    .coupon-table thead,
    .coupon-table td:first-child:not(.empty) {
        display: none;
    }

    .coupon-table tr {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas:
            "name name status"
            "code code code"
            "expiry site site";
        gap: 6px 8px;
        align-items: center;
        padding: 12px 16px;
        border-bottom: 1px solid var(--color-line-soft);
    }

    /* 칸이 일곱 개라 폰에서는 세 줄 카드로: 경기·결과 / 선택·배당·금액 / 일시·지급 */
    .bet-table,
    .bet-table tbody {
        display: block;
    }

    .bet-table thead {
        display: none;
    }

    .bet-table tr {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas:
            "race race result"
            "pick odds amount"
            "when when payout";
        gap: 4px 12px;
        align-items: center;
        padding: 10px 16px;
        border-bottom: 1px solid var(--color-line-soft);
    }

    .board-table.bet-table td {
        height: auto;
        padding: 0;
        border: 0;
        text-align: left;
    }

    .board-table.bet-table td.empty {
        grid-column: 1 / -1;
        padding: 40px 0;
        text-align: center;
    }

    .bet-table .bet-race { grid-area: race; font-size: 14px; font-weight: 600; white-space: nowrap; }
    .bet-table .bet-pick { grid-area: pick; white-space: nowrap; font-weight: 600; }
    /* 선택과 한 덩어리로 보이지 않게 구분선과 작은 회색으로 나눈다 */
    .board-table.bet-table .bet-odds { grid-area: odds; padding-left: 8px; border-left: 1px solid var(--color-border); color: var(--color-muted); font-size: 12px; }
    .bet-table .bet-odds::before { content: "배당 "; }
    .bet-table .bet-amount { grid-area: amount; }
    .board-table.bet-table .bet-result,
    .board-table.bet-table .bet-amount,
    .board-table.bet-table .bet-payout { text-align: right; }
    .bet-table .bet-result { grid-area: result; }
    .bet-table .history-when { grid-area: when; color: var(--color-muted); }
    .bet-table .bet-payout { grid-area: payout; }
    .bet-table .bet-payout::before { content: "지급 "; color: var(--color-muted); }

    /* 큰 금액이 겹쳐서 폰에서는 세 줄 카드로: 종류·누적 / 메모·보유 / 일시 */
    .point-table,
    .point-table tbody {
        display: block;
    }

    .point-table thead {
        display: none;
    }

    .point-table tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "type total"
            "memo available"
            "when when";
        gap: 4px 12px;
        align-items: center;
        padding: 10px 16px;
        border-bottom: 1px solid var(--color-line-soft);
    }

    .board-table.point-table td {
        height: auto;
        padding: 0;
        border: 0;
        text-align: left;
    }

    .board-table.point-table td.empty {
        grid-column: 1 / -1;
        padding: 40px 0;
        text-align: center;
    }

    .point-table .point-type { grid-area: type; font-size: 14px; font-weight: 600; }
    .point-table .point-memo { grid-area: memo; color: var(--color-muted); font-size: 12px; }
    .board-table.point-table .point-total,
    .board-table.point-table .point-available { text-align: right; white-space: nowrap; }
    .point-table .point-total { grid-area: total; }
    .point-table .point-available { grid-area: available; }
    .point-table .point-total::before { content: "누적 "; color: var(--color-muted); font-size: 12px; }
    .point-table .point-available::before { content: "보유 "; color: var(--color-muted); font-size: 12px; }
    .point-table .history-when { grid-area: when; color: var(--color-muted); }
    .box-table .point-total::before { content: "변화 "; }
    .box-table .point-available::before { content: "잔액 "; }

    /* 세 칸이 폰 너비를 나눠 써서 큰 금액이 칸 밖으로 밀린다 */
    .mypage-rank .side-points > div { min-width: 0; padding: 0 10px; }
    .mypage-rank .side-points dd { font-size: 14px; overflow-wrap: anywhere; }

    /* PC 칸 너비(.coupon-table .col-*)를 이겨야 해서 두 클래스 */
    .board-table.coupon-table td {
        width: auto;
        height: auto;
        padding: 0;
        border: 0;
        text-align: left;
    }

    .coupon-table td:nth-child(2) {
        grid-area: name;
        overflow: hidden;
        font-size: 15px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .coupon-table td:nth-child(3) { grid-area: code; }
    .coupon-table td:nth-child(4) { grid-area: expiry; }
    .coupon-table td:nth-child(5) { grid-area: site; }

    .coupon-table td:nth-child(4),
    .coupon-table td:nth-child(5) {
        color: var(--color-muted);
        font-size: 12px;
    }

    .coupon-table td:nth-child(4)::after {
        content: " ·";
    }

    /* 문자 발송 구매는 기한·사이트가 비어 " ·"만 남지 않게 */
    .coupon-table td:nth-child(4):empty,
    .coupon-table td:nth-child(5):empty {
        display: none;
    }

    .coupon-table td:nth-child(6) {
        grid-area: status;
        font-size: 12px;
        white-space: nowrap;
    }

    .coupon-table td.empty {
        grid-column: 1 / -1;
        padding: 40px 0;
        text-align: center;
    }

    .coupon-table .coupon-code-cell {
        justify-content: flex-start;
    }

    .coupon-table .coupon-copy {
        min-height: 44px;
    }

    .row-actions .btn {
        padding: 0 8px;
    }

    /* 게시판 목록은 행을 두 줄 카드로: 제목 / 작성자·날짜·조회 */
    .board-table:has(.col-no),
    .board-table:has(.col-no) tbody {
        display: block;
    }

    .board-table:has(.col-no) thead,
    .board-table:has(.col-no) tr:not(.pinned-row) .col-no {
        display: none;
    }

    .board-table:has(.col-no) tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        column-gap: 8px;
        padding: 12px 16px;
        border-bottom: 1px solid var(--color-line-soft);
    }

    .board-table:has(.col-no) td {
        width: auto;
        height: auto;
        padding: 0;
        border: 0;
        color: var(--color-muted);
        font-size: 12px;
    }

    .board-table:has(.col-no) .col-no {
        order: -3;
    }

    /* 카드형에선 칸이 떨어져 칸마다 칠하면 제목 뒤만 띠로 보임 */
    .board-table:has(.col-no) .pinned-row {
        background: var(--color-bg);
    }

    .board-table:has(.col-no) .pinned-row td {
        background: none;
    }

    .board-table:has(.col-no) td.title {
        flex: 1 1 0;
        order: -2;
        min-width: 0;
        color: var(--color-text);
        font-size: 15px;
    }

    /* 제목 줄과 정보 줄을 끊는 빈 칸 */
    .board-table:has(.col-no) tr::after {
        content: "";
        flex-basis: 100%;
        order: -1;
        height: 6px;
    }

    .board-table:has(.col-no) .col-author { max-width: 120px; }
    .board-table:has(.col-no) .col-date { order: 1; }
    .board-table:has(.col-no) .col-view { order: 2; }
    .board-table:has(.col-no) .col-like { order: 3; }
    .board-table:has(.col-no) .col-view::before { content: "조회 "; }
    .board-table:has(.col-no) .col-like::before { content: "추천 "; }

    .board-table:has(.col-no) td.empty {
        flex-basis: 100%;
        padding: 40px 0;
        font-size: 13px;
    }

    .board-table:has(.col-no) tr:has(.empty)::after {
        display: none;
    }

    /* 쪽지함도 닉네임이 잘리지 않게 두 줄 카드로: 닉네임·시각 / 제목 */
    .message-table,
    .message-table tbody {
        display: block;
    }

    .message-table thead {
        display: none;
    }

    .message-table tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        column-gap: 8px;
        row-gap: 4px;
        padding: 12px 16px;
        border-bottom: 1px solid var(--color-line-soft);
    }

    .message-table td {
        width: auto;
        height: auto;
        padding: 0;
        border: 0;
        color: var(--color-muted);
        font-size: 12px;
        text-align: left;
    }

    .message-table td.col-author {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
        color: var(--color-text);
        font-size: 13px;
        font-weight: 600;
    }

    .message-table td.col-date {
        width: auto;
        order: 1;
    }

    .message-table td.title {
        flex-basis: 100%;
        order: 2;
        color: var(--color-text);
        font-size: 15px;
    }

    .message-table td.empty {
        flex-basis: 100%;
        padding: 40px 0;
        font-size: 13px;
        text-align: center;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        padding: 12px;
    }

    .gallery-meta {
        flex-wrap: wrap;
        column-gap: 6px;
        row-gap: 0;
    }

    .coupon-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .coupon-card {
        padding-bottom: 12px;
    }

    .history-when {
        font-size: 12px;
    }

    .mypage-history th:first-child {
        width: 96px;
    }

    .coupon-card > :not(.coupon-image-link) {
        margin-inline: 12px;
    }

    .coupon-state {
        height: 44px;
    }

    .coupon-detail-top {
        gap: 12px;
        padding: 16px;
    }

    .coupon-detail-image {
        width: 96px;
    }

    .coupon-detail-name {
        font-size: 17px;
    }

    .coupon-detail-info .coupon-price {
        margin-top: 4px;
        font-size: 17px;
    }

    .coupon-detail-info .coupon-action {
        max-width: none;
    }

    .coupon-detail-body {
        max-width: none;
        margin-top: 16px;
    }

    .actions {
        flex-wrap: wrap;
    }

    .page .actions > :not(.link-copy-status) {
        flex: 1 1 0;
    }

    .page .actions .btn {
        width: 100%;
        min-height: 44px;
    }

    /* 아이콘이 붙어도 아래 줄 버튼 넷이 한 줄에 들어가게 */
    .page .actions .btn {
        gap: 4px;
        padding: 0 4px;
    }

    .page .actions .btn .ic {
        width: 14px;
        height: 14px;
    }

    .link-copy-status:empty {
        display: none;
    }

    .link-copy-status {
        flex-basis: 100%;
        order: 1;
        text-align: center;
    }

    .post-detail header,
    .post-detail .content {
        padding: 16px;
    }

    .post-detail .content {
        min-height: 120px;
    }

    .post-detail .post-images-view {
        padding: 16px 16px 0;
    }

    .post-detail .meta {
        flex-wrap: wrap;
        gap: 4px 12px;
    }

    .vote-bar {
        padding: 0 16px 16px;
    }

    .post-form {
        padding: 16px;
    }

    .phone-current {
        padding: 16px 16px 0;
    }

    .phone-ready {
        padding: 8px 16px 16px;
    }

    .mypage-form:not(.post-form) {
        padding: 16px;
    }

    .post-form .actions .btn {
        min-height: 48px;
    }

    .vr-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .vr-replay__search {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        padding: 12px;
    }

    .vr-replay__field {
        flex-wrap: wrap;
        gap: 4px 6px;
        min-width: 0;
    }

    .vr-replay__label {
        flex-basis: 100%;
        white-space: nowrap;
    }

    /* 표 안 가로 스크롤 중 아이폰 하단 탭바가 밀려서 칸을 쌓아 폭을 맞춤 */
    .vr-replay__table .vr-replay__wide {
        display: none;
    }

    .vr-replay__table .vr-replay__narrow {
        display: table-cell;
    }

    .vr-replay__table td.vr-replay__narrow {
        vertical-align: top;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .vr-replay__table .vr-replay__narrow .vr-replay__time {
        font-weight: 600;
    }

    .vr-replay__table .vr-replay__league {
        margin-top: 2px;
        color: var(--color-muted);
        font-size: 12px;
    }

    /* 펼침 화살표 너비만큼 들여 시각과 맞춤 */
    .vr-result__row .vr-replay__league {
        padding-left: 13px;
    }

    .vr-replay__table .vr-result__title {
        margin-bottom: 2px;
        font-weight: 600;
        white-space: pre-line;
    }

    .vr-replay__table .vr-replay__narrow + .vr-replay__narrow {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .vr-replay__table .vr-result__line:has(.vr-result__label) {
        display: grid;
        grid-template-columns: 4.2em minmax(0, 1fr);
        column-gap: 6px;
    }

    .vr-replay__table .vr-result__line + .vr-result__line {
        margin-top: 2px;
    }

    .vr-replay__table .vr-result__label {
        color: var(--color-muted);
        font-size: 12px;
        white-space: nowrap;
    }

    .vr-replay__table .vr-result__odds {
        white-space: nowrap;
    }

    .vr-result__results {
        grid-template-columns: minmax(0, auto) 1fr;
    }

    /* 아이폰은 16px 미만 입력칸을 누르면 화면을 확대함 */
    .vr-replay__field > :is(input, select) {
        font-size: 16px;
        flex: 1 1 0;
        width: 100%;
        min-width: 0;
    }

    .vr-replay__field[role="group"],
    .vr-replay__search > .btn {
        grid-column: 1 / -1;
    }

    .sports-frame {
        height: calc(100vh - 180px);
        height: calc(100dvh - 180px);
    }

    /* 입력줄 높이는 두고 아이콘 버튼 누르는 범위만 넓힘 */
    .chat-input-bar {
        gap: 14px;
    }

    .chat-input-bar .chat-icon-btn {
        position: relative;
    }

    .chat-input-bar .chat-icon-btn::after {
        content: "";
        position: absolute;
        inset: -8px -7px;
    }

    .chat-tabs a {
        height: 36px;
    }

    .chat-tabs-arrow {
        width: 32px;
        height: 32px;
    }

    /* 채팅 줄 간격은 그대로 두고 닉네임 누르는 범위만 넓힘 */
    .chat-nick {
        position: relative;
    }

    .chat-nick::after {
        content: "";
        position: absolute;
        inset: -10px -4px;
    }

    /* 카드 아무 곳이나 눌러도 글로 들어가게 */
    .board-table:has(.col-no) tr,
    .gallery-card,
    .pinned-list li {
        position: relative;
    }

    .board-table:has(.col-no) td.title a::after,
    .gallery-card a::after,
    .pinned-list a::after {
        content: "";
        position: absolute;
        inset: 0;
    }

    /* 닉네임은 카드 덮개 위에서 눌려야 회원 메뉴가 뜸 */
    .board-table:has(.col-no) .member-nick,
    .gallery-card .member-nick,
    .pinned-list .member-nick {
        position: relative;
        z-index: 1;
    }

    .comment-actions,
    .comment-votes {
        gap: 4px;
    }

    .comment-actions {
        flex-wrap: wrap;
        margin: -8px 0 -8px -8px;
    }

    .comment-link {
        min-height: 40px;
        padding: 0 8px;
    }

    .breadcrumb {
        align-items: baseline;
    }

    /* 본문 위쪽은 잘리므로 위는 자리를 늘리고 아래는 제목 위로 겹침 */
    .breadcrumb a {
        position: relative;
        display: inline-block;
        padding: 15px 4px;
        margin: 0 -4px -15px;
    }

    .crumb-menu summary {
        position: relative;
        padding: 15px 8px;
        margin: 0 -8px -15px;
    }

    .crumb-menu-list {
        top: 100%;
        font-size: 15px;
    }

    .breadcrumb .crumb-menu-list a {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 0 14px;
        margin: 0;
    }

    /* 보이는 크기는 두고 누르는 범위만 넓힘 */
    .vr-video__provider,
    .vr-replay__play,
    .auth-links a {
        position: relative;
    }

    .vr-video__provider {
        padding: 4px 14px;
    }

    .vr-video__provider::after,
    .vr-replay__play::after,
    .auth-links a::after {
        content: "";
        position: absolute;
    }

    /* 위로 넓히면 영상 조작줄을 가려서 아래로 넓힘 */
    .vr-video__provider::after {
        inset: -6px -2px -12px;
    }

    .vr-replay__play::after {
        inset: -10px -6px;
    }

    .vr-replay__table td {
        height: 40px;
    }

    .auth-links a::after {
        inset: -14px -4px;
    }

    .post-form label.auth-check {
        min-height: 44px;
    }

    .footer-links div {
        gap: 0;
    }

    .footer-links strong {
        height: 36px;
        display: flex;
        align-items: center;
        font-size: 14px;
        text-decoration: underline;
        text-underline-offset: 4px;
    }
    .footer-links a {
        height: 36px;
        display: flex;
        align-items: center;
        margin-left: 4px;
    }
}

.phone-nudge a,
.auth-links a,
.search-reset {
    color: var(--color-primary-dark);
    font-weight: 700;
    text-decoration: underline;
}

.auth-links {
    margin: 12px 0 0;
    text-align: center;
}

.mat {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'liga';
    vertical-align: middle;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    width: 1em;
    height: 1em;
    overflow: hidden;

    visibility: hidden;
}
.loaded .mat {
    visibility: visible;
    overflow: visible;
}
.icons-failed .mat {
    display: none;
}

.font-eng {
    font-family: "Verdana", "Roboto", sans-serif;
}

/* 다크 테마: 헤드 스크립트가 data-theme="dark"를 붙임 */
:root[data-theme="dark"] {
    --color-form-draw: #646a73;
    color-scheme: dark;
    --color-bg: #121315;
    --color-surface: #1c1d20;
    --color-text: #e6e8eb;
    --color-text-fixed: #333840;
    --color-muted: #9aa0a8;
    --color-border: #34373c;
    --color-border-soft: #575757;
    --color-fill: #24262a;
    --color-fill-soft: #202225;
    --color-fill-strong: #2b2d32;
    --color-primary-dark: #2fbf6a;
    --color-primary-soft: #173223;
    --color-primary-outline: #b9d5c330;
    --color-primary-hover: #00773a;
    --color-head-bg: #24262a;
    --color-blue: #5aa9e6;
    --color-blue-soft: #16283a;
    --color-gold: #e0b03a;
    --color-gold-soft: #33290f;
    --color-line-soft: #2a2c30;
    --color-accent: #ff5c66;
    --color-error: #ff6b6b;
    --color-error-soft: #3a1d20;
    --color-live-soft: #2e1a1c;
    --color-footer: #0b0c0d;
    --color-count: #FFFFFF;
    --color-black: #e6e8eb;
    --vr-text-sub: #b0b5bc;
    --vr-blue: #5aa9e6;
    --vr-blue-soft: #16283a;
    --vr-red: #ff6b6b;
    --vr-red-soft: #3a1d20;
    --vr-gold: #e0b03a;
    --vr-gold-soft: #33290f;
    --vr-silver: #aab2bd;
    --vr-bronze: #d9925f;
    --vr-bronze-soft: #33231a;
    --vr-orange: #f59a42;
    --vr-orange-soft: #35240f;
    --vr-olive: #b5c24a;
    --vr-olive-soft: #2a2e14;
    --vr-teal: #3cc4b8;
    --vr-green: #4cc76a;
    --vr-purple: #a48bff;
    --vr-scroll-thumb: rgba(255, 255, 255, 0.2);
    --vr-freeze-line: #4a4e55;
    --vr-scroll-thumb-hover: rgba(255, 255, 255, 0.45);
    /* 밝아진 순위 배경 위라 글자를 어둡게 */
    --vr-on-tone: #121315;
}

/* 형광펜 배경이 옅어 글자를 어둡게, 편집기는 color: inherit를 인라인으로 넣어 important */
:root[data-theme="dark"] :is(.content--html, .post-editor__body) mark {
    color: var(--color-text-fixed) !important;
}

:root[data-theme="dark"] :is(.content--html, .post-editor__body) span[style*="color"] mark {
    color: inherit !important;
}

:root[data-theme="dark"] .chat {
    --chat-fill: #24262a;
    --chat-hover: #2e3035;
    --chat-danger-soft: #3a1d20;
    --chat-text-soft: #a3a9b1;
}

:root[data-theme="dark"] ::placeholder {
    color: #a3a9b1;
}

/* 흰 글자를 얹는 자리라 밝아진 글자색 대신 원래 초록 */
:root[data-theme="dark"] .skip-link {
    background: var(--color-primary);
}

:root[data-theme="dark"] .gallery-thumb {
    background: var(--color-fill-strong);
}

:root[data-theme="dark"] .chat-handoff {
    background: rgba(28, 29, 32, 0.94);
}

:root[data-theme="dark"] .chat-login:hover {
    background: #1d3a29;
}

:root[data-theme="dark"] .chat-input-bar .chat-send:disabled {
    background: #3a3d43;
    color: #8a9099;
}

:root[data-theme="dark"] .chat-list .chat-randombox {
    background: linear-gradient(135deg, #222222, #000000),
    repeating-linear-gradient(45deg, #711516, #711516 10px, #666 10px, #666 20px, #1b4d3e, #1b4d3e 30px, #666 30px, #666 40px);
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

:root[data-theme="dark"] .chat ::-webkit-scrollbar-thumb {
    background: #3a3d43;
}

:root[data-theme="dark"] .chat ::-webkit-scrollbar-thumb:hover {
    background: #4a4e55;
}

:root[data-theme="dark"] .chat-alert--invite {
    border-color: #24425a;
}

:root[data-theme="dark"] .chat-alert--friend {
    border-color: #23472f;
    background: #173223;
}

:root[data-theme="dark"] .chat-alert--friend .chat-alert-icon {
    color: #4cc76a;
}

:root[data-theme="dark"] .activity-tag--blind {
    border-color: #5a2a2a;
    background: #2e1a1c;
}

@supports not selector(::-webkit-scrollbar) {
    :root[data-theme="dark"] .chat * {
        scrollbar-color: #3a3d43 transparent;
    }
}

.theme-toggle {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: var(--color-fill);
    color: var(--color-muted);
    cursor: pointer;
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-sun,
:root[data-theme="dark"] .theme-moon {
    display: none;
}

:root[data-theme="dark"] .theme-sun {
    display: block;
}

.drawer-head .theme-toggle {
    margin-left: auto;
}

/* 헤더 간격 32px 대신 회원 메뉴 버튼끼리 간격에 맞춤 */
.header-top > .theme-toggle {
    margin-left: -24px;
}

@media (max-width: 1023px) {
    .header-top > .theme-toggle {
        display: none;
    }
}

/* 올리브색 병 계급장은 어두운 바탕에 묻혀서 밝게 */
:root[data-theme="dark"] img:is([src*="PRIVATE"], [src*="CORPORAL"], [src*="/SERGEANT."], [src*="/SERGEANT-"]) {
    filter: brightness(1.8);
}
:root[data-theme="dark"] img:is([src*="RECRUIT"]) {
    filter: brightness(1.25);
}

/* 게시판 단축키·랜덤 새 글 */
.bsc-dice {
    display: none;
}

.bsc-status {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 41;
    margin: 0;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--color-text);
    color: var(--color-surface);
    font-size: 13px;
    transform: translateX(-50%);
}

.bsc-status:empty {
    display: none;
}

.bsc-keys {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 6px 12px;
    margin: 0 0 12px;
}

.bsc-keys dd {
    margin: 0;
}

.bsc-keys kbd {
    display: inline-block;
    min-width: 26px;
    padding: 2px 6px;
    border: 1px solid var(--color-border);
    border-bottom-width: 2px;
    border-radius: 4px;
    background: var(--color-fill);
    font: inherit;
    font-size: 12px;
    text-align: center;
}

.bsc-touch {
    margin: 0;
    color: var(--color-muted);
    font-size: 13px;
}

@media (max-width: 1023px) {
    /* 맨 위로 버튼 바로 위, 탭바와 안 겹치게 */
    .bsc-dice {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        right: calc(12px + env(safe-area-inset-right));
        bottom: calc(116px + env(safe-area-inset-bottom));
        z-index: 39;
        width: 40px;
        height: 40px;
        padding: 0;
        border: 1px solid var(--color-border);
        border-radius: 50%;
        background: var(--color-surface);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        font-size: 20px;
        cursor: pointer;
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
        touch-action: manipulation;
    }

    .bsc-status {
        bottom: calc(68px + env(safe-area-inset-bottom));
    }

    body.is-drawer-open .bsc-dice,
    body.is-chat-open .bsc-dice,
    body.is-boards-open .bsc-dice {
        display: none;
    }
}

/* 알림 켜기 띠, PC는 오른쪽 채팅 칸을 피해 본문 칸 가운데 */
.push-prompt {
    position: fixed;
    left: calc(50% - 172px);
    bottom: 24px;
    z-index: 41;
    display: flex;
    align-items: center;
    gap: 12px;
    width: max-content;
    max-width: calc(min(100vw, 1392px) - 424px);
    padding: 10px 12px 10px 16px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateX(-50%);
}

.push-prompt[hidden],
.push-prompt-actions[hidden] {
    display: none;
}

.push-prompt-text {
    margin: 0;
    font-size: 14px;
    word-break: keep-all;
}

.push-prompt-actions {
    display: flex;
    flex-shrink: 0;
    gap: 6px;
}

.push-prompt .btn {
    height: 32px;
    padding: 0 12px;
}

.push-prompt-steps {
    margin: 0 0 16px;
    padding-left: 20px;
    line-height: 1.8;
}

/* 글자가 들어올 때만 덮개로 보임, 허용 창은 브라우저 화면이라 클릭은 막지 않음 */
.push-allow {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 160px 24px 0;
    pointer-events: none;
}

.push-allow:not(:empty) {
    background: rgba(0, 0, 0, 0.45);
}

.push-allow span {
    padding: 12px 18px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 17px;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

/* 문구가 허용 창에 가리지 않게 창 바깥쪽에 둠 */
.push-allow[data-device="ios"] {
    justify-content: center;
    padding: 18vh 16px 0;
}

.push-allow:is([data-device="android"], [data-device="mobile"]) {
    align-items: flex-end;
    justify-content: center;
    padding: 0 16px 45vh;
}

@media (max-width: 1023px) {
    /* 탭바 위로 솟은 채팅 버튼 바로 위, 오른쪽 맨 위로·🎲 버튼 자리는 비워 둠 */
    .push-prompt {
        left: calc(12px + env(safe-area-inset-left));
        right: calc(64px + env(safe-area-inset-right));
        bottom: calc(76px + env(safe-area-inset-bottom));
        flex-wrap: wrap;
        gap: 8px;
        width: auto;
        max-width: none;
        padding: 10px 12px;
        transform: none;
    }
}
