.sb-overlay {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px 12px 86px;
    background: rgba(0, 0, 0, .58);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.sb-overlay.is-open { display: flex; }
body.sb-lock { overflow: hidden !important; }
.sb-dialog {
    position: relative;
    width: min(520px, calc(100vw - 24px));
    max-height: min(86vh, 760px);
    overflow-y: auto;
    border-radius: 22px;
    background: linear-gradient(180deg, #fff 0%, #fff7ec 100%);
    color: #1b1b1f;
    box-shadow: 0 28px 90px rgba(0, 0, 0, .45), 0 0 0 3px rgba(255, 138, 0, .22);
    font-family: inherit;
}
.sb-dialog::-webkit-scrollbar { width: 5px; }
.sb-dialog::-webkit-scrollbar-thumb { background: #ff9a21; border-radius: 999px; }
.sb-header {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    background: linear-gradient(90deg, #ff1f2c, #ff8a00);
    color: #fff;
    border-radius: 22px 22px 0 0;
}
.sb-header__badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .22);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .16);
    font-size: 22px;
}
.sb-title {
    margin: 0;
    font-size: 24px;
    line-height: 1.05;
    font-weight: 900;
    text-shadow: 0 2px 0 rgba(0, 0, 0, .12);
}
.sb-subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    font-weight: 700;
    opacity: .94;
}
.sb-refresh,
.sb-close-x {
    border: 0;
    background: rgba(255, 255, 255, .22);
    color: #fff;
    cursor: pointer;
}
.sb-refresh {
    margin-left: auto;
    width: 38px;
    height: 38px;
    border-radius: 12px;
}
.sb-close-x {
    position: absolute;
    right: 8px;
    top: -42px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
}
.sb-loading {
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #ff6b00;
    font-weight: 800;
}
.sb-body { padding: 16px 18px 20px; }
.sb-stage {
    position: relative;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 20px;
    background:
        radial-gradient(circle at 50% 45%, rgba(255, 212, 89, .45), transparent 33%),
        linear-gradient(135deg, #171725 0%, #271120 46%, #35130b 100%);
    border: 2px solid rgba(255, 138, 0, .28);
}
.sb-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(45deg, rgba(255,255,255,.06) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.06) 50%, rgba(255,255,255,.06) 75%, transparent 75%, transparent);
    background-size: 34px 34px;
    opacity: .45;
}
.sb-stage-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    pointer-events: none;
    animation: sb-bg-float 8s ease-in-out infinite;
}
.sb-image {
    position: relative;
    z-index: 3;
    width: min(82%, 340px);
    max-height: 310px;
    object-fit: contain;
    filter: drop-shadow(0 16px 22px rgba(0, 0, 0, .42));
    user-select: none;
    pointer-events: none;
    animation: sb-float 3s ease-in-out infinite;
}
.sb-image.is-hidden { display: none; }
.sb-question {
    position: relative;
    z-index: 4;
    width: 146px;
    height: 146px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .96);
    color: #ff2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 96px;
    font-weight: 900;
    box-shadow: 0 18px 40px rgba(0,0,0,.32), inset 0 0 0 8px #ffe16b;
}
.sb-glow {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    width: 260px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 138, 0, .26);
    filter: blur(10px);
}
@keyframes sb-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
@keyframes sb-bg-float {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}
.sb-info-card {
    position: relative;
    z-index: 3;
    margin-top: -18px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 12px 34px rgba(255, 88, 0, .16);
    border: 1px solid rgba(255, 138, 0, .18);
}
.sb-name-row,
.sb-hp-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.sb-boss-name {
    font-size: 21px;
    line-height: 1.15;
    font-weight: 900;
    color: #151515;
}
.sb-reward {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fff1bf;
    color: #e55500;
    font-weight: 900;
    white-space: nowrap;
}
.sb-hp-label {
    margin-top: 12px;
    color: #575757;
    font-size: 14px;
    font-weight: 800;
}
.sb-hp-label strong { color: #111; }
.sb-hp-bar {
    height: 18px;
    margin-top: 6px;
    border-radius: 999px;
    overflow: hidden;
    background: #eee;
    border: 2px solid #fff;
    box-shadow: inset 0 2px 4px rgba(0,0,0,.13);
}
.sb-hp-fill {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, #08be00, #ffe14d, #ff2b2b);
    transition: width .18s ease;
}
.sb-message {
    margin-top: 12px;
    min-height: 22px;
    color: #414141;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}
.sb-countdown {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    background: #fff7df;
    border: 1px solid #ffd26a;
    color: #9b5a00;
    text-align: center;
    font-weight: 800;
}
.sb-countdown span { color: #ff3a00; font-weight: 900; letter-spacing: .5px; }
.sb-hit-btn {
    width: 100%;
    min-height: 50px;
    margin-top: 14px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(90deg, #ff2632, #ff8a00);
    color: #fff;
    font-size: 19px;
    font-weight: 900;
    letter-spacing: .4px;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(255, 82, 0, .28);
    transition: transform .1s ease, opacity .15s ease;
}
.sb-hit-btn:hover:not(:disabled) { transform: translateY(-1px); }
.sb-hit-btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.sb-hit-btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.sb-hit-btn.is-hit { animation: sb-hit-shake .18s ease; }
@keyframes sb-hit-shake {
    0%,100% { transform: translateX(0); }
    30% { transform: translateX(-3px); }
    70% { transform: translateX(3px); }
}
.sb-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.sb-stat-card,
.sb-section {
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(255, 138, 0, .16);
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(0,0,0,.05);
}
.sb-stat-card {
    padding: 12px;
    text-align: center;
}
.sb-stat-card span {
    display: block;
    color: #777;
    font-size: 13px;
    font-weight: 800;
}
.sb-stat-card strong {
    display: block;
    margin-top: 4px;
    color: #ff3a00;
    font-size: 21px;
    line-height: 1;
    font-weight: 900;
}
.sb-section { margin-top: 12px; padding: 13px 14px; }
.sb-section-title {
    color: #ff3a00;
    font-size: 15px;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 6px;
}
.sb-section-text {
    color: #545454;
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-line;
}
.sb-top-list { display: grid; gap: 7px; }
.sb-top-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #fff7ea;
    color: #333;
    font-weight: 800;
    font-size: 13px;
}
.sb-top-item span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-top-empty { color: #777; font-size: 14px; }
.sb-close-bottom {
    position: fixed;
    left: 50%;
    bottom: 34px;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #fff;
    background: transparent;
    color: #fff;
    font-size: 32px;
    line-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
@media (max-width: 560px) {
    .sb-overlay { padding: 68px 8px 76px; align-items: flex-start; }
    .sb-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 148px); border-radius: 18px; }
    .sb-header { padding: 13px 14px; border-radius: 18px 18px 0 0; }
    .sb-title { font-size: 20px; }
    .sb-subtitle { font-size: 12px; }
    .sb-body { padding: 12px; }
    .sb-stage { min-height: 220px; }
    .sb-image { width: min(88%, 300px); max-height: 260px; }
    .sb-boss-name { font-size: 18px; }
    .sb-hit-btn { min-height: 48px; font-size: 17px; }
    .sb-stat-grid { grid-template-columns: 1fr 1fr; }
    .sb-close-x { display: none; }
}

/* ===== Boss Sever UI vui hon: Pokemon icons + click animation ===== */
.sb-title-wrap {
    min-width: 0;
}
.sb-pokemon-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    min-height: 22px;
}
.sb-pokemon-row img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 2px 1px rgba(0,0,0,.24));
    animation: sb-icon-bounce 1.75s ease-in-out infinite;
}
.sb-pokemon-row img:nth-child(2) { animation-delay: .12s; }
.sb-pokemon-row img:nth-child(3) { animation-delay: .24s; }
.sb-pokemon-row img:nth-child(4) { animation-delay: .36s; }
.sb-pokemon-row img:nth-child(5) { animation-delay: .48s; }
.sb-stage::before { z-index: 1; }
.sb-pokemon-cloud {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}
.sb-pokemon-cloud img {
    position: absolute;
    width: 34px;
    height: 34px;
    object-fit: contain;
    image-rendering: pixelated;
    opacity: .88;
    filter: drop-shadow(0 4px 4px rgba(0,0,0,.42));
    animation: sb-cloud-float 3.2s ease-in-out infinite;
}
.sb-pokemon-cloud img:nth-child(1) { left: 8%; top: 12%; animation-delay: 0s; }
.sb-pokemon-cloud img:nth-child(2) { right: 10%; top: 11%; animation-delay: .25s; }
.sb-pokemon-cloud img:nth-child(3) { left: 17%; top: 45%; animation-delay: .5s; }
.sb-pokemon-cloud img:nth-child(4) { right: 18%; top: 43%; animation-delay: .75s; }
.sb-pokemon-cloud img:nth-child(5) { left: 10%; bottom: 13%; animation-delay: 1s; }
.sb-pokemon-cloud img:nth-child(6) { right: 11%; bottom: 15%; animation-delay: 1.25s; }
.sb-pokemon-cloud img:nth-child(7) { left: 39%; top: 8%; animation-delay: 1.5s; }
.sb-pokemon-cloud img:nth-child(8) { right: 39%; bottom: 9%; animation-delay: 1.75s; }
.sb-pokemon-cloud img:nth-child(9) { left: 48%; bottom: 26%; animation-delay: 2s; }
.sb-stage.is-attacking {
    animation: sb-stage-hit .22s ease;
}
.sb-image.is-attacked {
    animation: sb-boss-hit .28s ease, sb-float 3s ease-in-out infinite .28s;
}
.sb-hit-fx {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    opacity: 0;
}
.sb-hit-fx::before,
.sb-hit-fx::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 190px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.95), #ffe56b, #ff3b2f, transparent);
    box-shadow: 0 0 16px rgba(255, 223, 85, .8);
    transform: translate(-50%, -50%) rotate(-22deg) scaleX(.25);
}
.sb-hit-fx::after {
    transform: translate(-50%, -50%) rotate(22deg) scaleX(.25);
}
.sb-hit-fx.is-show {
    animation: sb-flash .26s ease;
}
.sb-hit-fx.is-show::before {
    animation: sb-slash-left .26s ease;
}
.sb-hit-fx.is-show::after {
    animation: sb-slash-right .26s ease;
}
.sb-damage-pop {
    position: absolute;
    left: 50%;
    top: 38%;
    z-index: 6;
    transform: translate(-50%, -50%);
    padding: 4px 11px;
    border-radius: 999px;
    background: rgba(255, 46, 46, .95);
    color: #fff;
    font-size: 26px;
    font-weight: 1000;
    line-height: 1;
    text-shadow: 0 2px 0 rgba(0,0,0,.25);
    box-shadow: 0 7px 18px rgba(0,0,0,.26);
    pointer-events: none;
    animation: sb-damage-pop .62s ease-out forwards;
}
.sb-spark-mon {
    position: absolute;
    z-index: 5;
    width: 28px;
    height: 28px;
    object-fit: contain;
    image-rendering: pixelated;
    pointer-events: none;
    filter: drop-shadow(0 4px 4px rgba(0,0,0,.42));
    animation: sb-spark-mon .7s ease-out forwards;
}
@keyframes sb-icon-bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-3px) scale(1.08); }
}
@keyframes sb-cloud-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-9px) rotate(6deg); }
}
@keyframes sb-stage-hit {
    0%,100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    55% { transform: translateX(4px); }
}
@keyframes sb-boss-hit {
    0% { transform: translateY(0) scale(1); filter: drop-shadow(0 16px 22px rgba(0,0,0,.42)); }
    45% { transform: translateY(-6px) scale(1.045) rotate(-2deg); filter: drop-shadow(0 0 18px rgba(255,255,255,.92)) drop-shadow(0 16px 22px rgba(0,0,0,.42)); }
    100% { transform: translateY(0) scale(1); filter: drop-shadow(0 16px 22px rgba(0,0,0,.42)); }
}
@keyframes sb-flash {
    0% { opacity: 0; }
    30% { opacity: 1; }
    100% { opacity: 0; }
}
@keyframes sb-slash-left {
    0% { transform: translate(-50%, -50%) rotate(-22deg) scaleX(.15); }
    60% { transform: translate(-50%, -50%) rotate(-22deg) scaleX(1.05); }
    100% { transform: translate(-50%, -50%) rotate(-22deg) scaleX(.3); }
}
@keyframes sb-slash-right {
    0% { transform: translate(-50%, -50%) rotate(22deg) scaleX(.15); }
    60% { transform: translate(-50%, -50%) rotate(22deg) scaleX(1.05); }
    100% { transform: translate(-50%, -50%) rotate(22deg) scaleX(.3); }
}
@keyframes sb-damage-pop {
    0% { opacity: 0; transform: translate(-50%, -30%) scale(.65); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
    100% { opacity: 0; transform: translate(-50%, -118%) scale(.9); }
}
@keyframes sb-spark-mon {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(.4) rotate(0deg); }
    18% { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--sb-x, 42px), var(--sb-y, -58px)) scale(1.12) rotate(var(--sb-r, 20deg)); }
}
@media (max-width: 560px) {
    .sb-pokemon-row img { width: 20px; height: 20px; }
    .sb-pokemon-cloud img { width: 28px; height: 28px; }
    .sb-damage-pop { font-size: 22px; }
    .sb-spark-mon { width: 24px; height: 24px; }
}
