/* =========================================================
   BẢNG XẾP HẠNG trang chủ (#bang-xep-hang) — theo bộ UI "Vinh danh cao thủ Kiếm Sơn".
   Ảnh chất liệu ở assets/ranking/*.webp (không chữ); chữ & số liệu do assets/bxh.js vẽ.
   Màu: giấy #FFF8EC · chữ #51351E · đỏ son #A83D27 · vàng viền #CF9C55 · xanh ngọc #15524C.
   ========================================================= */
.ks-bxh {
    --paper: #FFF8EC;
    --ink: #51351E;
    --son: #A83D27;
    --gold: #CF9C55;
    --gold-d: #855018;
    --jade: #15524C;
    --jade-d: #0E3C38;
    position: relative;
    padding: 64px 0 72px;
    color: var(--ink);
    background: #F8F1E5 url("/assets/ranking/bg-son-thuy.webp") center / cover no-repeat;
}
.ks-bxh-in {
    position: relative;
    isolation: isolate;
    width: min(1240px, calc(100% - 48px));
    margin: 0 auto;
    padding: 46px 52px 44px;
}
@media (min-width: 1101px) { .ks-bxh-in { width: min(1240px, calc(100% - 320px)); } }
/* khung giấy cổ viền vàng (ảnh), kéo giãn theo khối */
.ks-bxh-in::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: url("/assets/ranking/khung-chinh.webp") center / 100% 100% no-repeat;
    filter: drop-shadow(0 22px 40px rgba(90, 60, 20, .22));
}

/* ---------- tiêu đề + hoa văn mây ---------- */
.ks-bxh-head {
    position: relative;
    display: grid;
    justify-items: center;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}
.ks-bxh-head::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 8px -30px 4px;
    background: url("/assets/ranking/hoa-van-tieu-de.webp") center / 100% 100% no-repeat;
}
.ks-bxh-eyebrow {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .32em;
    text-transform: uppercase;
    color: var(--gold-d);
}
.ks-bxh .ks-bxh-head h2 {
    margin: 2px 0 0;
    padding: .06em .2em .16em;
    font-family: "FZ GameBR", var(--serif);
    font-size: clamp(44px, 4.8vw, 70px);
    font-weight: 400;
    line-height: 1.15;
    color: var(--son);
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    text-shadow: 0 2px 0 #FFF6E8, 0 6px 14px rgba(168, 61, 39, .2);
    filter: none;
}
.ks-bxh .ks-bxh-head p { margin: 0; font-size: 16px; color: var(--ink); }

/* ---------- thanh tab + máy chủ ---------- */
.ks-bxh-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 28px 4px 18px;
}
.ks-bxh-tabs { display: flex; gap: 6px; }
.mh-body .ks-bxh-tabs button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 148px;
    height: 50px;
    padding: 0 20px 2px;
    font-size: 17px;
    font-weight: 800;
    color: var(--ink);
    background: url("/assets/ranking/nut-tab-inactive.webp") center / 100% 100% no-repeat;
    transition: transform .15s, filter .2s;
}
.mh-body .ks-bxh-tabs button.is-on {
    color: #fff;
    background-image: url("/assets/ranking/nut-tab-active.webp");
    text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.mh-body .ks-bxh-tabs button:hover { filter: brightness(1.05); }
.ks-bxh-tabs svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- lưới 2 cột ---------- */
.ks-bxh-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
}

/* trái: nền ngọc có rồng + bục 3 hạng (ảnh) + chân dung (ảnh) + chữ */
.ks-bxh-stage {
    position: relative;
    container-type: inline-size;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 0;
    padding: 4cqw 3cqw 0;
    background: url("/assets/ranking/nen-top3.webp") center / 100% 100% no-repeat;
    overflow: hidden;
}
.ks-bxh-podium {
    position: relative;
    z-index: 2;
    display: grid;
    /* khớp bề ngang 3 khối bục trong ảnh: bạc · vàng · đồng */
    grid-template-columns: 31% 36% 31%;
    justify-content: space-between;
    align-items: end;
    margin: 0;
    padding: 0;
    list-style: none;
}
.ks-bxh-podium li {
    display: grid;
    justify-items: center;
    gap: .9cqw;
    min-width: 0;
    /* hai bên đứng thấp hơn: chân chồm xuống phần bục thấp */
    margin-bottom: -7.2cqw;
    text-align: center;
    color: #FCE9B6;
}
.ks-bxh-podium li.is-top1 { margin-bottom: -.5cqw; }
.ks-bxh-ava {
    display: block;
    width: 82%;
    height: auto;
    margin-bottom: .4cqw;
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .35));
}
.is-top1 .ks-bxh-ava { width: 88%; filter: drop-shadow(0 0 22px rgba(255, 216, 106, .5)) drop-shadow(0 8px 14px rgba(0, 0, 0, .35)); }
.ks-bxh-podium .ks-bxh-name {
    max-width: 100%;
    overflow: hidden;
    font-size: clamp(14px, 3.6cqw, 22px);
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #FFF3D2;
    text-shadow: 0 2px 4px #07352F;
}
.is-top1 .ks-bxh-name { font-size: clamp(16px, 4.2cqw, 26px); color: #FFE38A; }
.ks-bxh-podium .ks-bxh-lv {
    padding: .3cqw 2cqw;
    border-radius: 999px;
    font-size: clamp(11px, 2.4cqw, 14px);
    font-weight: 700;
    color: #E6F3EE;
    background: rgba(14, 60, 56, .75);
    box-shadow: inset 0 0 0 1px rgba(207, 156, 85, .65);
}
.ks-bxh-podium .ks-bxh-val {
    margin-top: .3cqw;
    padding: .5cqw 2.4cqw;
    border-radius: 999px;
    font-size: clamp(12px, 2.7cqw, 16px);
    font-weight: 800;
    color: #412A16;
    background: linear-gradient(#FFFFFF, #E6BB67);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}
.ks-bxh-podium li:not(.is-top1) .ks-bxh-val { background: linear-gradient(#FFFFFF, #E3E6EA); }
.ks-bxh-podium li.is-top3 .ks-bxh-val { background: linear-gradient(#FFF3E8, #EBB58A); }

/* bục (ảnh) + số hạng */
.ks-bxh-steps { position: relative; z-index: 1; }
.ks-bxh-steps img { display: block; width: 100%; height: auto; }
.ks-bxh-steps i {
    position: absolute;
    transform: translate(-50%, -50%);
    font-family: "FZ GameBR", var(--serif);
    font-size: clamp(26px, 7.5cqw, 52px);
    font-style: normal;
    line-height: 1;
    color: #fff;
    text-shadow: 0 2px 4px rgba(116, 74, 24, .85);
}
.ks-bxh-steps .is-2 { left: 16.5%; top: 62%; color: #F4F6F8; text-shadow: 0 2px 4px rgba(70, 80, 95, .9); }
.ks-bxh-steps .is-1 { left: 50%; top: 52%; font-size: clamp(32px, 9cqw, 64px); }
.ks-bxh-steps .is-3 { left: 83.5%; top: 62%; text-shadow: 0 2px 4px rgba(110, 55, 20, .9); }

/* phải: bảng hạng 4–10 (CSS, nền giấy viền vàng như ảnh mẫu) */
.ks-bxh-board {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 16px 16px 14px;
    border: 1.5px solid var(--gold);
    border-radius: 14px;
    background: linear-gradient(180deg, #FFFCF4, #FBF1DD);
    box-shadow: inset 0 0 0 3px rgba(255, 252, 244, .9), inset 0 0 0 4px rgba(207, 156, 85, .35);
}
.ks-bxh-cols,
.ks-bxh-list li {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 66px 104px;
    align-items: center;
    gap: 10px;
}
.ks-bxh-cols {
    padding: 0 14px 10px;
    border-bottom: 1px solid #E8D3A2;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #94612B;
}
.ks-bxh-cols span:last-child, .ks-bxh-list .ks-bxh-val { text-align: right; }
.ks-bxh-cols span:nth-child(3), .ks-bxh-list .ks-bxh-lv { text-align: center; }
.ks-bxh-list { display: grid; gap: 7px; margin: 10px 0 0; padding: 0; list-style: none; }
.ks-bxh-list li {
    min-height: 48px;
    padding: 5px 14px;
    border: 1px solid #ECD9B0;
    border-radius: 10px;
    font-size: 16px;
    background: #FFFDF8;
    transition: transform .2s, box-shadow .2s, background .2s;
}
.ks-bxh-list li:hover { transform: translateX(3px); background: #FFF6E2; box-shadow: inset 3px 0 0 var(--son), 0 6px 14px rgba(110, 72, 18, .1); }
.ks-bxh-no {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid #D5A149;
    border-radius: 50%;
    font-weight: 900;
    color: #8B5210;
    background: #F8E4B6;
}
.ks-bxh-list .ks-bxh-name { overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.ks-bxh-list .ks-bxh-lv {
    justify-self: center;
    padding: 3px 9px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 900;
    color: #15564E;
    background: #D9E9E1;
}
.ks-bxh-list .ks-bxh-val { font-weight: 900; color: #A62B1D; white-space: nowrap; }
.ks-bxh-empty { margin: 30px 0; text-align: center; font-size: 16px; color: #90704F; }
.ks-bxh-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: auto 0 0 !important;
    padding-top: 12px;
    font-size: 13px;
    color: #90704F;
}
.ks-bxh-foot::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #45B373; box-shadow: 0 0 0 3px #D3E7D8; }

/* ---------- đang tải ---------- */
.is-skel .ks-bxh-name, .ks-bxh-list li.is-skel > span:not(.ks-bxh-no) {
    color: transparent !important;
    border-radius: 6px;
    text-shadow: none !important;
    background: linear-gradient(90deg, rgba(255, 255, 255, .15) 25%, rgba(255, 255, 255, .4) 50%, rgba(255, 255, 255, .15) 75%) 0 0 / 200% 100%;
    animation: ks-skel 1.2s linear infinite;
}
.ks-bxh-podium .is-skel .ks-bxh-name { width: 70%; height: 16px; }
.ks-bxh-podium .is-skel .ks-bxh-ava { opacity: .55; }
.ks-bxh-list li.is-skel > .ks-bxh-name, .ks-bxh-list li.is-skel > span:not(.ks-bxh-no) {
    height: 14px;
    background-image: linear-gradient(90deg, #F2E6CB 25%, #FBF4E4 50%, #F2E6CB 75%);
}
@keyframes ks-skel { to { background-position: -200% 0; } }

/* đổi máy chủ / tab: nội dung mới hiện lần lượt */
.ks-bxh-grid.is-swap .ks-bxh-podium li { animation: ks-bxh-rise .45s cubic-bezier(.2, .7, .2, 1) both; }
.ks-bxh-grid.is-swap .ks-bxh-podium li.is-top1 { animation-delay: .08s; }
.ks-bxh-grid.is-swap .ks-bxh-podium li.is-top3 { animation-delay: .14s; }
.ks-bxh-grid.is-swap .ks-bxh-list li { animation: ks-bxh-fade .35s ease both; animation-delay: calc(var(--i, 0) * 40ms + 120ms); }
@keyframes ks-bxh-rise { from { opacity: 0; transform: translateY(20px); } }
@keyframes ks-bxh-fade { from { opacity: 0; transform: translateX(-10px); } }

/* ---------- màn hẹp ---------- */
@media (max-width: 1000px) {
    .ks-bxh-in { padding: 38px 32px 34px; }
    .ks-bxh-grid { grid-template-columns: 1fr; }
    .ks-bxh-stage, .ks-bxh-board { width: 100%; max-width: 680px; margin: 0 auto; }
}
@media (max-width: 600px) {
    .ks-bxh { padding: 36px 0 44px; }
    .ks-bxh-in { width: calc(100% - 16px); padding: 34px 16px 26px; }
    .ks-bxh-head::before { inset: 4px -10px 2px; }
    .ks-bxh-eyebrow { font-size: 10px; letter-spacing: .26em; }
    .ks-bxh .ks-bxh-head p { font-size: 13px; }
    .ks-bxh-bar { flex-direction: column; align-items: stretch; margin: 20px 0 14px; gap: 10px; }
    .ks-bxh-tabs { justify-content: center; }
    .mh-body .ks-bxh-tabs button { flex: 1; min-width: 0; height: 44px; font-size: 15px; }
    .ks-bxh-board { padding: 12px 8px 10px; }
    .ks-bxh-cols, .ks-bxh-list li { grid-template-columns: 36px minmax(0, 1fr) 46px 74px; gap: 6px; }
    .ks-bxh-cols { padding: 0 8px 8px; font-size: 11px; }
    .ks-bxh-list li { min-height: 44px; padding: 4px 8px; font-size: 14px; }
    .ks-bxh-no { width: 28px; height: 28px; font-size: 13px; }
    .ks-bxh-list .ks-bxh-lv { padding: 2px 6px; font-size: 12px; }
    .ks-bxh-foot { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .ks-bxh-grid.is-swap li, .is-skel * { animation: none !important; }
}

/* =========================================================
   Ô CHỌN MÁY CHỦ (tự dựng, thay danh sách mặc định của trình duyệt)
   ========================================================= */
.ks-bxh-server { position: relative; z-index: 5; display: block; }
.ks-bxh-server > svg { display: none; }
.mh-body .ks-dd-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 270px;
    padding: 8px 16px 8px 14px;
    border: 1px solid #D9B061;
    border-radius: 14px;
    text-align: left;
    color: #4A3514;
    background: linear-gradient(180deg, #FFFDF7, #FBF1DA);
    box-shadow: 0 2px 8px rgba(110, 72, 18, .08), inset 0 1px 0 #fff;
    transition: border-color .2s, box-shadow .2s;
}
.mh-body .ks-dd-btn:hover,
.ks-dd-btn[aria-expanded="true"] { border-color: var(--son); box-shadow: 0 0 0 3px rgba(168, 38, 28, .12), 0 6px 16px rgba(110, 72, 18, .12); }
.ks-dd-btn > svg {
    width: 34px;
    height: 34px;
    padding: 8px;
    flex: none;
    border-radius: 10px;
    fill: none;
    stroke: #FFF6DC;
    stroke-width: 2;
    stroke-linecap: round;
    background: linear-gradient(135deg, #2A8583, var(--jade-d));
}
.ks-dd-label { display: grid; flex: 1; min-width: 0; line-height: 1.25; }
.ks-dd-label small { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #9C8458; }
.ks-dd-label b { overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.ks-dd-caret {
    width: 9px;
    height: 9px;
    flex: none;
    margin-top: -4px;
    border: solid #B9761E;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    transition: transform .25s, margin .25s;
}
.ks-dd-btn[aria-expanded="true"] .ks-dd-caret { margin-top: 4px; transform: rotate(-135deg); }

.ks-dd-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: max(100%, 300px);
    padding: 10px;
    border-radius: 16px;
    background: #FFFDF7;
    box-shadow: 0 0 0 1px #E2C27A, 0 0 0 5px rgba(255, 253, 247, .95), 0 0 0 6px #E8CF92, 0 22px 44px rgba(80, 50, 10, .25);
    transform-origin: top right;
    animation: ks-dd-in .18s cubic-bezier(.2, .7, .2, 1);
}
@keyframes ks-dd-in { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
.ks-dd-search { position: relative; margin-bottom: 8px; }
.ks-dd-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    fill: none;
    stroke: #B9A27A;
    stroke-width: 2;
    stroke-linecap: round;
}
.ks-dd-search input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    border: 1px solid #EAD7AC;
    border-radius: 10px;
    font: inherit;
    font-size: 15px;
    color: #4A3514;
    background: #FBF5E6;
    outline: none;
}
.ks-dd-search input:focus { border-color: #D9B061; background: #fff; }
.ks-dd-list {
    max-height: 300px;
    margin: 0;
    padding: 0 4px 0 0;
    overflow-y: auto;
    list-style: none;
    scrollbar-width: thin;
    scrollbar-color: #D9B061 transparent;
}
.ks-dd-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #4A3514;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.ks-dd-list li::before {
    content: "";
    width: 7px;
    height: 7px;
    flex: none;
    border-radius: 50%;
    background: #3BAA6B;
    box-shadow: 0 0 0 3px rgba(59, 170, 107, .18);
}
.ks-dd-list li em {
    margin-left: auto;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #D9473A, #A8261C);
}
.ks-dd-list li.is-active { background: #F6EBCF; }
.ks-dd-list li[aria-selected="true"] {
    color: #fff;
    background: linear-gradient(135deg, #2A8583, var(--jade-d));
}
.ks-dd-list li[aria-selected="true"]::before { background: #FFE38A; box-shadow: 0 0 0 3px rgba(255, 227, 138, .3); }
.ks-dd-list li[aria-selected="true"]::after {
    content: "";
    width: 6px;
    height: 11px;
    margin: -3px 2px 0 4px;
    border: solid #FFE38A;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.ks-dd-list li[aria-selected="true"] em { background: #FFE38A; color: #7A3A05; }
.ks-dd-list li[aria-selected="true"]:has(em)::after { margin-left: 8px; }
.ks-dd-list li:not(:has(em))[aria-selected="true"]::after { margin-left: auto; }
.ks-dd-none { margin: 10px 0 6px !important; text-align: center; font-size: 14px; color: #9C8458; }
@media (max-width: 760px) {
    .mh-body .ks-dd-btn { min-width: 0; width: 100%; }
    .ks-dd-panel { left: 0; right: 0; width: auto; }
}

/* nút chọn máy chủ dùng ảnh khung của bộ UI (ảnh có sẵn icon server bên trái + mũi tên bên phải) */
.mh-body .ks-dd-btn {
    min-width: 300px;
    height: 50px;
    padding: 0 15% 2px 17%;
    border: 0;
    border-radius: 0;
    background: url("/assets/ranking/khung-chon-server.webp") center / 100% 100% no-repeat;
    box-shadow: none;
}
.mh-body .ks-dd-btn:hover,
.ks-dd-btn[aria-expanded="true"] { border: 0; box-shadow: none; filter: brightness(1.04) drop-shadow(0 0 6px rgba(207, 156, 85, .6)); }
.ks-dd-btn > svg, .ks-dd-caret { display: none; }
.ks-dd-label small { display: none; }
.ks-dd-label b { font-size: 16px; font-weight: 800; color: var(--ink); text-align: center; }
@media (max-width: 600px) {
    .ks-bxh-server { align-self: center; width: min(320px, 100%); }
    .mh-body .ks-dd-btn { width: 100%; min-width: 0; height: 46px; }
}
@media (max-width: 600px) {
    .ks-bxh-head::before { inset: 0 -8px 26px; } /* hoa văn mây không đè dòng giới thiệu */
}

/* =========================================================
   HIỆU ỨNG TOP 1 · 2 · 3
   tia sáng xoay sau chân dung · chân dung bồng bềnh + quầng sáng nhịp
   · sao lấp lánh quanh hạng 1 · vệt sáng lướt qua 3 bục
   ========================================================= */
.ks-bxh-podium li { --glow: 200, 210, 225; position: relative; }      /* bạc */
.ks-bxh-podium li.is-top1 { --glow: 255, 214, 100; }                 /* vàng */
.ks-bxh-podium li.is-top3 { --glow: 240, 160, 100; }                 /* đồng */

/* tia sáng xoay phía sau chân dung */
.ks-bxh-podium li::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    z-index: -1;
    width: 118%;
    aspect-ratio: 1;
    border-radius: 50%;
    transform: translate(-50%, -9%);
    background:
        radial-gradient(circle, rgba(var(--glow), .55) 0, rgba(var(--glow), .18) 38%, transparent 66%),
        repeating-conic-gradient(from 0deg, rgba(var(--glow), .38) 0deg 7deg, transparent 7deg 22deg);
    -webkit-mask-image: radial-gradient(circle, #000 30%, transparent 68%);
    mask-image: radial-gradient(circle, #000 30%, transparent 68%);
    animation: ks-rays 18s linear infinite;
    pointer-events: none;
}
.ks-bxh-podium li.is-top1::before { width: 135%; transform: translate(-50%, -13%); animation-duration: 12s; }
@keyframes ks-rays { to { transform: translate(-50%, var(--ty, -9%)) rotate(360deg); } }
.ks-bxh-podium li.is-top1 { --ty: -13%; }

/* chân dung bồng bềnh + quầng sáng nhịp theo màu hạng */
.ks-bxh-ava { animation: ks-float 3.6s ease-in-out infinite, ks-aura 2.4s ease-in-out infinite; }
.ks-bxh-podium li.is-top2 .ks-bxh-ava { animation-delay: -1.2s, -.8s; }
.ks-bxh-podium li.is-top3 .ks-bxh-ava { animation-delay: -2.4s, -1.6s; }
@keyframes ks-float { 50% { transform: translateY(-5px); } }
@keyframes ks-aura {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(var(--glow), .45)) drop-shadow(0 8px 14px rgba(0, 0, 0, .35)); }
    50% { filter: drop-shadow(0 0 20px rgba(var(--glow), .95)) drop-shadow(0 8px 14px rgba(0, 0, 0, .35)); }
}
.ks-bxh-podium li.is-top1 .ks-bxh-name { animation: ks-name-glow 2.4s ease-in-out infinite; }
@keyframes ks-name-glow { 50% { text-shadow: 0 2px 4px #07352F, 0 0 14px rgba(255, 220, 120, .9); } }

/* sao lấp lánh quanh hạng 1 */
.ks-bxh-podium li.is-top1::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    width: 130%;
    aspect-ratio: 1;
    transform: translate(-50%, -12%);
    background:
        radial-gradient(circle, #fff 0 1.5px, rgba(255, 230, 150, .9) 2px, transparent 4px) 8% 30% / 14px 14px no-repeat,
        radial-gradient(circle, #fff 0 1.5px, rgba(255, 230, 150, .9) 2px, transparent 4px) 90% 22% / 12px 12px no-repeat,
        radial-gradient(circle, #fff 0 1px, rgba(255, 230, 150, .9) 1.5px, transparent 3px) 82% 70% / 10px 10px no-repeat,
        radial-gradient(circle, #fff 0 1px, rgba(255, 230, 150, .9) 1.5px, transparent 3px) 16% 76% / 10px 10px no-repeat,
        radial-gradient(circle, #fff 0 1.5px, rgba(255, 230, 150, .9) 2px, transparent 4px) 50% 2% / 14px 14px no-repeat;
    animation: ks-sparkle 2.2s ease-in-out infinite;
    pointer-events: none;
}
@keyframes ks-sparkle {
    0%, 100% { opacity: .25; }
    50% { opacity: 1; }
}

/* vệt sáng lướt qua 3 bục (chỉ trên phần có hình bục) */
.ks-bxh-steps::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .55) 48%, transparent 60%) -150% 0 / 60% 100% no-repeat;
    -webkit-mask: url("/assets/ranking/buc-top3.webp") center / 100% 100% no-repeat;
    mask: url("/assets/ranking/buc-top3.webp") center / 100% 100% no-repeat;
    animation: ks-step-shine 4.5s ease-in-out infinite;
    pointer-events: none;
}
@keyframes ks-step-shine { 0%, 25% { background-position: -150% 0; } 75%, 100% { background-position: 250% 0; } }
/* số hạng sáng nhẹ */
.ks-bxh-steps .is-1 { animation: ks-num 2.4s ease-in-out infinite; }
@keyframes ks-num { 50% { text-shadow: 0 2px 4px rgba(116, 74, 24, .85), 0 0 18px rgba(255, 235, 160, .95); } }

/* trạng thái tải: tắt hiệu ứng cho đỡ rối */
.ks-bxh-podium li.is-skel::before, .ks-bxh-podium li.is-skel::after { display: none; }
.ks-bxh-podium li.is-skel .ks-bxh-ava { animation: none; }

@media (prefers-reduced-motion: reduce) {
    .ks-bxh-podium li::before, .ks-bxh-podium li::after, .ks-bxh-ava, .ks-bxh-steps::after,
    .ks-bxh-steps .is-1, .ks-bxh-podium li.is-top1 .ks-bxh-name { animation: none !important; }
}
/* tia sáng rõ hơn cho cả 3 hạng */
.ks-bxh-podium li::before {
    background:
        radial-gradient(circle, rgba(var(--glow), .7) 0, rgba(var(--glow), .3) 40%, transparent 68%),
        repeating-conic-gradient(from 0deg, rgba(var(--glow), .65) 0deg 6deg, transparent 6deg 20deg);
    -webkit-mask-image: radial-gradient(circle, #000 34%, transparent 70%);
    mask-image: radial-gradient(circle, #000 34%, transparent 70%);
}

/* ĐIỆN THOẠI: bỏ hẳn nền ngoài (tranh sơn thủy + khung giấy kéo giãn), nội dung tràn bề ngang */
@media (max-width: 600px) {
    .ks-bxh { padding: 28px 0 32px; background: #FFF8EC; }
    .ks-bxh-in { width: 100%; padding: 0 12px; }
    .ks-bxh-in::before { display: none; }
}

/* Font chữ: Be Vietnam Pro (đủ độ đậm 400–900, rõ nét ở cỡ nhỏ) thay Barlow Semi Condensed
   (Barlow không có 800 nên trình duyệt nhảy lên 900, chữ dày và nhòe). Tiêu đề thư pháp giữ FZ GameBR. */
.ks-bxh,
.ks-bxh button,
.ks-bxh input {
    font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.mh-body .ks-bxh-tabs button { font-size: 16px; font-weight: 700; letter-spacing: .01em; }
.ks-dd-label b { font-size: 15px; font-weight: 700; }
.ks-bxh-eyebrow { font-weight: 700; }
.ks-bxh .ks-bxh-head p { font-size: 15px; }
.ks-bxh-cols { font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.ks-bxh-list li { font-size: 15px; }
.ks-bxh-list .ks-bxh-name { font-weight: 600; color: #3E2812; }
.ks-bxh-no { font-size: 14px; font-weight: 700; }
.ks-bxh-list .ks-bxh-lv { font-size: 12px; font-weight: 700; }
.ks-bxh-list .ks-bxh-val { font-weight: 700; }
.ks-bxh-podium .ks-bxh-name { font-weight: 700; }
.ks-bxh-podium .ks-bxh-lv { font-weight: 600; }
.ks-bxh-podium .ks-bxh-val { font-weight: 700; }
.ks-dd-list li { font-weight: 500; }
.ks-dd-search input { font-size: 14px; }
@media (max-width: 600px) {
    .mh-body .ks-bxh-tabs button { font-size: 15px; }
    .ks-bxh-list li { font-size: 13.5px; }
    .ks-bxh-cols { font-size: 10.5px; }
}
/* số hạng đặt đúng tâm khung hoa văn mặt trước của từng khối (đo trên buc-top3.webp 1100x289):
   bạc x≈16,4% y≈53% · vàng x=50% y≈42% · đồng x≈82,7% y≈53% */
.ks-bxh-steps i { line-height: 1; transform: translate(-50%, -50%); }
.ks-bxh-steps .is-2 { left: 16.4%; top: 53%; }
.ks-bxh-steps .is-1 { left: 50%; top: 42%; }
.ks-bxh-steps .is-3 { left: 82.7%; top: 53%; }

/* chân bảng trang chủ: thời gian cập nhật + nút xem top 100 */
.ks-bxh-board-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; margin-top: auto; padding-top: 12px; }
.ks-bxh-board-foot .ks-bxh-foot { padding-top: 0; }
.mh-body .ks-bxh-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(180deg, #D9473A, #A8261C 60%, #861810);
    box-shadow: 0 4px 10px rgba(168, 38, 28, .3);
    transition: transform .2s, filter .2s;
}
.ks-bxh-more::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 2px 2px 0 0; transform: rotate(45deg); }
.mh-body .ks-bxh-more:hover { color: #fff; filter: brightness(1.08); transform: translateY(-1px); }
/* (trang chủ) cùng lý do: chừa khoảng dưới tiêu đề thư pháp */
.ks-bxh .ks-bxh-head h2 { line-height: 1.1; padding-bottom: .34em; }
.ks-bxh .ks-bxh-head p { position: relative; z-index: 1; }

/* "Tất cả máy chủ": tên máy chủ nhỏ dưới tên người chơi, nhãn "Gộp" trong danh sách */
.ks-bxh-podium .ks-bxh-sv { margin-top: -2px; font-size: 12px; font-weight: 600; color: #BFE3DA; text-shadow: 0 1px 2px #07352F; }
.ks-bxh-list .ks-bxh-name .ks-bxh-sv { display: block; margin-top: 1px; font-size: 11.5px; font-weight: 500; color: #2A7A72; }
.ks-dd-list li em.is-all { background: linear-gradient(135deg, #2A8583, #124A4C); }
.ks-dd-list li:first-child { margin-bottom: 4px; border-bottom: 1px dashed #E6D3A8; border-radius: 10px 10px 4px 4px; }

/* pháo hoa trong khung top 3 (assets/ks-fireworks.js): phủ khung, nằm sau bục & chân dung */
.ks-bxh-stage .ks-fw { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }

/* Điện thoại: chân bảng xếp dọc, căn giữa; nút Top 100 trải full ngang (trước bị lệch trái, lơ lửng) */
@media (max-width: 640px) {
    .ks-bxh-board-foot { flex-direction: column; align-items: stretch; gap: 10px; }
    .ks-bxh-board-foot .ks-bxh-foot { justify-content: center; text-align: center; }
    .mh-body .ks-bxh-board-foot .ks-bxh-more { justify-content: center; padding: 11px 18px; font-size: 15px; border-radius: 10px; }
}
