﻿/* CONTAINER TỔNG THỂ - KHÓA TỶ LỆ DẠNG KHUNG ĐIỆN THOẠI TRÊN WEB */
.broracing-container {
    position: relative;
    width: 100vw;
    width: 100dvw;
    max-width: 450px;
    height: 100vh;
    height: 100dvh;
    margin: 0 auto;
    background: #0b1329 url('/images/games/broracing/bg.png') center center / cover no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    overflow: hidden;
    user-select: none;
    font-family: 'DePixel Breit', monospace, sans-serif;
    color: #ffffff;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.8);
}

/* 1. TOP HEADER HIỂN THỊ CẶP NÚT BACK, BALANCE VÀ CỤM ACTION BUTTONS */
.broracing-top-header {
    width: 100%;
    height: auto;
    min-height: 42px;
    padding: 6px 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    box-sizing: border-box;
    z-index: 10;
}

/* NÚT BACK QUAY LẠI LOBBY */
.broracing-back-btn {
    background: #1886b5;
    border: 1.5px solid #00f0ff;
    color: #ffffff;
    font-weight: bold;
    font-size: 14px;
    border-radius: 6px;
    padding: 3px 12px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    outline: none;
    transition: transform 0.1s ease, filter 0.1s ease;
    font-family: 'DePixel Breit', monospace, sans-serif;
}

    .broracing-back-btn:hover {
        filter: brightness(1.2);
    }

    .broracing-back-btn:active {
        transform: scale(0.95);
    }

/* TOP RIGHT GROUP NỐI BALANCE VÀ CỤM NÚT ACTION */
.broracing-top-right-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

/* THANH HIỂN THỊ SỐ DƯ TIỀN VỚI MẪU KHUNG TIỀN PIXEL */
.broracing-balance-pill {
    background: url('/images/games/broracing/khungtien.png') center center / 100% 100% no-repeat;
    border: none;
    border-radius: 0;
    padding: 4px 14px;
    font-size: 11px;
    font-weight: bold;
    color: #ffe600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 30px;
    min-width: 130px;
    box-sizing: border-box;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.coin-icon {
    width: 15px;
    height: 15px;
    object-fit: contain;
    image-rendering: pixelated;
}

.broracing-balance-val {
    color: #ffe600;
    font-weight: bold;
    text-shadow: 1px 1px 0px #000;
}

/* CỤM 3 NÚT ACTION DỌC (ÂM THANH, LỊCH SỬ, PLAY) */
.broracing-action-buttons-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
    z-index: 10;
}

.broracing-action-btn {
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.5);
    border: 1.5px solid #38bdf8;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    transition: transform 0.1s ease, filter 0.1s ease, border-color 0.1s ease;
}

    .broracing-action-btn:hover {
        filter: brightness(1.2);
        border-color: #ffe600;
    }

    .broracing-action-btn:active {
        transform: scale(0.92);
    }

.broracing-action-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

/* 2. BÀN POKER PIXEL CONTAINER */
.broracing-table-wrapper {
    width: 100%;
    height: 93%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 4px 6px 8px 6px;
    box-sizing: border-box;
}

.broracing-poker-table {
    position: relative;
    width: 100%;
    height: 100%;
    background: url('/images/games/broracing/table.png') center center / 100% 100% no-repeat;
    display: flex;
    box-sizing: border-box;
}

/* TOAST THÔNG BÁO DIỄN BIẾN TRÊN MẶT BÀN */
.broracing-status-toast {
    position: absolute;
    top: 2.5%;
    left: 8%;
    right: 8%;
    background: rgba(15, 23, 42, 0.94);
    border: 1.5px solid #00f0ff;
    border-radius: 6px;
    padding: 4px 8px;
    text-align: center;
    font-size: 9.5px;
    color: #facc15;
    font-weight: bold;
    z-index: 15;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
    animation: broracingToastFade 0.3s ease-out;
}

@keyframes broracingToastFade {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* QUY CHUẨN KÍCH THƯỚC VÀ HIỂN THỊ CÁC LÁ BÀI */
.broracing-card-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

/* HE THONG TỌA ĐỘ VỊ TRÍ CHUẨN (STEP 0 -> STEP 5) */
.broracing-step-pos-0 {
    bottom: -18% !important;
}

.broracing-step-pos-1 {
    bottom: 0% !important;
}

.broracing-step-pos-2 {
    bottom: 20% !important;
}

.broracing-step-pos-3 {
    bottom: 40% !important;
}

.broracing-step-pos-4 {
    bottom: 60% !important;
}

.broracing-step-pos-5 {
    bottom: 80% !important;
}

/* CÁC ĐƯỜNG GIÓNG HÀNG NGANG MỜ ĐÚNG MỐC BẪY 1 -> 5 */
.broracing-grid-lines-container {
    position: absolute;
    left: 4.5%;
    right: 6%;
    top: 10%;
    bottom: 22%;
    pointer-events: none;
    z-index: 2;
}

.broracing-track-line {
    position: absolute;
    left: 0;
    right: 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
}

.step-1-line {
    bottom: 8%;
}

.step-2-line {
    bottom: 28%;
}

.step-3-line {
    bottom: 48%;
}

.step-4-line {
    bottom: 68%;
}

.step-5-line {
    bottom: 88%;
}

/* CỘT 5 LÁ BÀI BẪY DỌC MÉP TRÁI BÀN */
.broracing-traps-vertical-stack {
    position: absolute;
    left: 4.5%;
    top: 10%;
    bottom: 22%;
    width: 18%;
    height: 68%;
    z-index: 5;
}

.broracing-trap-card-slot {
    position: absolute;
    left: 0;
    width: 100%;
    height: 16%;
    aspect-ratio: 57 / 81;
    display: flex;
    align-items: center;
    justify-content: center;
}

.broracing-card-flip {
    animation: broracingCardFlipAnim 0.35s ease-out;
}

@keyframes broracingCardFlipAnim {
    0% {
        transform: scaleX(0);
    }

    100% {
        transform: scaleX(1);
    }
}

/* KHU VỰC ĐƯỜNG ĐUA JOKER */
.broracing-race-field {
    position: absolute;
    left: 26%;
    right: 6%;
    top: 10%;
    bottom: 22%;
    height: 68%;
}

/* VẠCH ĐÍCH STEP 5 (NẰM PHÍA TRÊN LÁ BẪY 5) */
.broracing-finish-line-banner {
    position: absolute;
    top: -5%;
    left: 0;
    right: 0;
    height: 16px;
    background: repeating-linear-gradient(45deg, #000, #000 8px, #fff 8px, #fff 16px);
    border: 1px solid #facc15;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #facc15;
    font-size: 8px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
    z-index: 8;
}

/* PHÂN CHIA LÀN JOKER */
.broracing-lane-column {
    position: absolute;
    top: 0;
    bottom: 0;
    height: 100%;
}

.broracing-red-lane-col {
    left: 2%;
    width: 28%;
}

.broracing-black-lane-col {
    left: 36%;
    width: 28%;
}

/* LÁ BÀI DỰ ĐUA TRÊN ĐƯỜNG ĐUA */
.broracing-racer-card-item {
    width: 100%;
    height: 16%;
    aspect-ratio: 57 / 81;
    position: absolute;
    will-change: bottom;
    transition: bottom 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 6;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
}

    .broracing-racer-card-item:hover {
        filter: brightness(1.2);
    }

    .broracing-racer-card-item.broracing-racer-disabled {
        cursor: not-allowed;
        pointer-events: none;
        filter: none;
    }

/* HIỂN THỊ SỐ TIỀN CƯỢC MÀU VÀNG PHÍA DƯỚI LÁ BÀI JOKER */
.broracing-racer-bet-amount {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 2px;
    color: #ffe600;
    font-family: 'DePixel Breit', monospace, sans-serif;
    font-size: clamp(10px, 2.5vw, 12px);
    font-weight: 900;
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 0 2px 4px rgba(0,0,0,0.8);
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
}

/* Ô LÁ BÀI RÚT (NẰM CỐ ĐỊNH Ở LEVEL 0) */
.broracing-drawn-card-slot {
    position: absolute;
    left: 70%;
    bottom: -18%;
    width: 28%;
    height: 16%;
    aspect-ratio: 57 / 81;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ANIMATION CHIA BÀI BAY TỪ DECK CARD ĐẾN DRAWN SLOT */
.broracing-drawn-anim {
    animation: broracingFlyFromDeck 0.45s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes broracingFlyFromDeck {
    0% {
        transform: translate3d(-175%, 25%, 0) scale(0.65) rotate(-25deg);
        opacity: 0.1;
    }

    40% {
        transform: translate3d(-85%, -25%, 0) scale(1.1) rotate(-12deg);
        opacity: 0.95;
    }

    100% {
        transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* KHU VỰC ĐÁY BÀN (DECK CARD & NÚT DEAL CARDS) */
.broracing-table-controls-overlay {
    position: absolute;
    bottom: 0%;
    left: 28%;
    right: 6%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
}

.broracing-deck-card-box {
    width: 26%;
    max-width: 44px;
    height: auto;
    aspect-ratio: 57 / 81;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

.broracing-deck-anim {
    animation: broracingDeckPulse 0.3s ease-in-out;
}

@keyframes broracingDeckPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: translateY(-8px) scale(1.12);
        filter: brightness(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.broracing-deal-cards-btn {
    background: linear-gradient(180deg, #facc15 0%, #ca8a04 100%);
    border: 2px solid #ffffff;
    border-radius: 8px;
    color: #1e1b4b;
    font-family: 'DePixel Breit', monospace, sans-serif;
    font-size: clamp(10px, 2.8vw, 12px);
    font-weight: bold;
    padding: clamp(6px, 1.2vh, 10px) clamp(10px, 2.5vw, 16px);
    box-shadow: 0 4px 10px rgba(250, 204, 21, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.6);
    cursor: pointer;
    text-shadow: 0 1px 0 #fef08a;
    transition: transform 0.1s ease, filter 0.1s ease;
}

    .broracing-deal-cards-btn:active {
        transform: translateY(2px);
        box-shadow: 0 2px 5px rgba(250, 204, 21, 0.5);
    }

    .broracing-deal-cards-btn.broracing-disabled {
        background: #64748b;
        border-color: #94a3b8;
        color: #cbd5e1;
        box-shadow: none;
        text-shadow: none;
        cursor: not-allowed;
    }

/* POPUP MÀN HÌNH CÚP CHIẾN THẮNG OVERLAY */
.broracing-trophy-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 19, 41, 0.88);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: trophyModalFadeIn 0.4s ease-out forwards;
}

.broracing-trophy-card {
    background: linear-gradient(180deg, #1e1b4b 0%, #0f172a 100%);
    border: 2px solid #facc15;
    border-radius: 16px;
    padding: 20px 15px;
    width: 80%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 0 35px rgba(250, 204, 21, 0.4), inset 0 0 15px rgba(250, 204, 21, 0.2);
    animation: trophyPopUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.broracing-lottie-trophy-box {
    width: 220px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.broracing-winner-title {
    font-size: 16px;
    font-weight: bold;
    color: #facc15;
    text-shadow: 0 0 10px rgba(250, 204, 21, 0.8);
    margin-top: 10px;
    text-align: center;
}

.broracing-winner-name {
    font-size: 13px;
    color: #00f0ff;
    margin-top: 6px;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

@keyframes trophyModalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes trophyPopUp {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ================= POPUP ĐẶT CƯỢC JOKER RACING ================= */
.broracing-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    backdrop-filter: blur(3px);
    animation: broracingModalFadeIn 0.25s ease-out;
}

.broracing-modal-card {
    width: 100%;
    max-width: 360px;
    background: #2a3352;
    border: 2px solid #4a5a8a;
    border-radius: 14px;
    padding: 16px 14px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.9), inset 0 0 6px rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: 'DePixel Breit', monospace, sans-serif;
    color: #ffffff;
    box-sizing: border-box;
}

/* HEADER CHỨA CẶP LÁ BÀI JOKER */
.broracing-modal-joker-header {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 4px;
}

.broracing-modal-joker-select {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.broracing-modal-joker-card {
    position: relative;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    border: 2px solid transparent;
    opacity: 0.55;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

    .broracing-modal-joker-card:hover {
        opacity: 0.85;
        transform: translateY(-2px);
    }

    .broracing-modal-joker-card.selected {
        opacity: 1;
        transform: scale(1.12);
    }

    .broracing-modal-joker-card.red.selected {
        border-color: #ef4444;
        box-shadow: 0 0 15px rgba(239, 68, 68, 0.85);
    }

    .broracing-modal-joker-card.black.selected {
        border-color: #38bdf8;
        box-shadow: 0 0 15px rgba(56, 189, 248, 0.85);
    }

.broracing-modal-joker-img {
    width: 46px;
    height: 64px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.7));
    display: block;
}

/* KHUNG LƯỚI 2 HÀNG x 5 CỘT PRESET BUTTONS */
.broracing-preset-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 6px;
    width: 100%;
}

.broracing-preset-btn {
    background: #1e2942;
    border: 1.5px solid #3b82f6;
    border-radius: 6px;
    color: #ffffff;
    font-family: inherit;
    font-size: 10px;
    font-weight: bold;
    padding: 8px 0;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
    transition: transform 0.1s ease, filter 0.1s ease, background 0.1s ease;
    text-shadow: 1px 1px 2px #000;
}

    .broracing-preset-btn:hover {
        filter: brightness(1.25);
        background: #2563eb;
        transform: translateY(-1px);
    }

    .broracing-preset-btn:active {
        transform: scale(0.95);
    }

/* DÒNG Bet Value */
.broracing-modal-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: #ffffff;
    gap: 8px;
    margin-top: 2px;
}

.broracing-summary-label {
    white-space: nowrap;
    font-weight: bold;
}

.broracing-input-wrapper {
    flex: 1;
    max-width: 140px;
}

.broracing-bet-input {
    width: 100%;
    background: #121829;
    border: 1.5px solid #3b82f6;
    border-radius: 8px;
    color: #ffe600;
    font-family: inherit;
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    padding: 6px 4px;
    box-sizing: border-box;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.7);
}

/* DÒNG NÚT CANCEL & OK */
.broracing-modal-actions-row {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.broracing-btn-cancel {
    flex: 1;
    background: linear-gradient(180deg, #f97316 0%, #ea580c 100%);
    border: 2px solid #fdba74;
    border-radius: 18px;
    color: #ffffff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 900;
    padding: 9px 0;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 4px 8px rgba(0, 0, 0, 0.6);
    text-shadow: 1px 1px 2px #000;
    transition: transform 0.1s ease, filter 0.1s ease;
}

    .broracing-btn-cancel:hover {
        filter: brightness(1.15);
    }

    .broracing-btn-cancel:active {
        transform: scale(0.96);
    }

.broracing-btn-confirm {
    flex: 1.5;
    background: linear-gradient(180deg, #facc15 0%, #eab308 100%);
    border: 2px solid #fef08a;
    border-radius: 18px;
    color: #000000;
    font-family: inherit;
    font-size: 13px;
    font-weight: 900;
    padding: 9px 0;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 4px 8px rgba(0, 0, 0, 0.6);
    text-shadow: 0.5px 0.5px 0 rgba(255, 255, 255, 0.8);
    transition: transform 0.1s ease, filter 0.1s ease;
}

    .broracing-btn-confirm:hover {
        filter: brightness(1.15);
    }

    .broracing-btn-confirm:active {
        transform: scale(0.96);
    }

@keyframes broracingModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ================= POPUP LỊCH SỬ CƯỢC & HƯỚNG DẪN CHƠI ================= */
.broracing-history-modal-card {
    position: relative;
    width: 92%;
    max-width: 380px;
    height: 80vh;
    max-height: 560px;
    background: transparent url('/images/games/brodice/khung_popup.png') center center / 100% 100% no-repeat;
    display: flex;
    flex-direction: column;
    padding: 24px 18px 20px 18px;
    box-sizing: border-box;
    image-rendering: pixelated;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.95);
    animation: broracingModalPop 0.25s ease-out;
}

@keyframes broracingModalPop {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.broracing-history-modal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    margin-bottom: 14px;
    padding-top: 4px;
}

.broracing-history-title-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.broracing-title-star-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.broracing-title-history-img {
    height: 22px;
    width: auto;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.broracing-title-howtoplay-img {
    height: 22px;
    width: auto;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.broracing-history-close-btn {
    position: absolute;
    top: 0;
    right: 4px;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

    .broracing-history-close-btn:hover {
        filter: brightness(1.25);
    }

    .broracing-history-close-btn:active {
        transform: scale(0.9);
    }

.broracing-close-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    image-rendering: pixelated;
}

/* POPUP HƯỚNG DẪN CHƠI CONTENT */
.broracing-howtoplay-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow-y: auto;
    padding: 10px 8px;
    box-sizing: border-box;
}

.broracing-howtoplay-text {
    font-family: 'DePixel Breit', monospace, sans-serif;
    font-size: 12px;
    line-height: 1.6;
    color: #e2e8f0;
    text-shadow: 1px 1px 2px #000;
    margin: 0;
    text-align: justify;
}

/* POPUP LỊCH SỬ CONTENT */
.broracing-history-table-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
    margin-top: 2px;
}

.broracing-history-table-header {
    display: grid;
    grid-template-columns: 1.1fr 1.5fr 1.2fr 1.3fr;
    align-items: center;
    text-align: center;
    font-family: 'DePixel Breit', monospace, sans-serif;
    font-size: 10px;
    color: #88a2d4;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    font-weight: bold;
}

.broracing-history-table-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

    .broracing-history-table-body::-webkit-scrollbar,
    .broracing-howtoplay-content-wrapper::-webkit-scrollbar {
        width: 4px;
    }

    .broracing-history-table-body::-webkit-scrollbar-thumb,
    .broracing-howtoplay-content-wrapper::-webkit-scrollbar-thumb {
        background: rgba(56, 189, 248, 0.5);
        border-radius: 4px;
    }

.broracing-history-row {
    display: grid;
    grid-template-columns: 1.1fr 1.5fr 1.2fr 1.3fr;
    align-items: center;
    text-align: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-family: 'DePixel Breit', monospace, sans-serif;
    font-size: 11px;
}

.col-phien {
    color: #ffffff;
    font-weight: bold;
    word-break: break-all;
}

.col-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.col-bet {
    color: #00f0ff;
    font-weight: bold;
}

.col-win {
    color: #ffe600;
    font-weight: bold;
}


/* ==========================================================================
   BRORACING HOW-TO-PLAY CONTENT & SCROLLBAR STYLES
   ========================================================================== */

/* THẺ BỌC CHÍNH CÓ THANH CUỘN (SCROLL) */
.broracing-howtoplay-content-wrapper {
    font-family: 'DePixel Breit', monospace, sans-serif;
    color: #e2e8f0;
    font-size: 10px;
    line-height: 1.6;
    text-shadow: 1px 1px 2px #000000;
    /* CẤU HÌNH CUỘN (SCROLL) */
    max-height: 380px; /* Giới hạn chiều cao hiển thị trong Modal */
    overflow-y: auto; /* Tự động hiện thanh cuộn dọc khi quá cao */
    padding-right: 8px; /* Chống đè nội dung lên thanh cuộn */
    box-sizing: border-box;
    text-align: left;
}

    /* TIÊU ĐỀ H2 */
    .broracing-howtoplay-content-wrapper h2 {
        font-size: 12px;
        color: #facc15; /* Màu vàng pixel */
        margin: 14px 0 6px 0;
        font-weight: bold;
        border-bottom: 1px dashed rgba(250, 204, 21, 0.35);
        padding-bottom: 4px;
        text-transform: uppercase;
    }

        .broracing-howtoplay-content-wrapper h2:first-child {
            margin-top: 0;
        }

    /* TIÊU ĐỀ MỤC BƯỚC CHƠI H3 */
    .broracing-howtoplay-content-wrapper h3 {
        font-size: 10.5px;
        color: #38bdf8; /* Màu xanh cyan */
        margin: 10px 0 4px 0;
        font-weight: bold;
    }

    /* ĐOẠN VĂN BẢN P */
    .broracing-howtoplay-content-wrapper p {
        margin: 4px 0 8px 0;
        color: #cbd5e1;
        font-size: 9.5px;
    }

    /* ĐỊNH DẠNG CÁC THẺ NHẤN MẠNH */
    .broracing-howtoplay-content-wrapper strong {
        color: #ffffff;
        font-weight: bold;
    }

    .broracing-howtoplay-content-wrapper em {
        color: #94a3b8;
        font-style: italic;
    }

    /* DANH SÁCH UL & OL */
    .broracing-howtoplay-content-wrapper ul,
    .broracing-howtoplay-content-wrapper ol {
        margin: 4px 0 10px 0;
        padding-left: 16px;
    }

    .broracing-howtoplay-content-wrapper li {
        margin-bottom: 6px;
        font-size: 9.5px;
        color: #cbd5e1;
    }

/* CÁC THẺ BADGE CHỊU TÁC ĐỘNG CỦA PHE ĐỎ / ĐEN */
.broracing-badge-red {
    background-color: #7f1d1d;
    color: #fca5a5;
    border: 1px solid #ef4444;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: bold;
}

.broracing-badge-black {
    background-color: #1e293b;
    color: #38bdf8;
    border: 1px solid #0284c7;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: bold;
}

/* KHUNG GHI CHÚ BLOCKQUOTE */
.broracing-howtoplay-content-wrapper blockquote {
    background: rgba(15, 23, 42, 0.85);
    border-left: 3px solid #facc15;
    margin: 10px 0;
    padding: 8px 10px;
    border-radius: 0 6px 6px 0;
    color: #fef08a;
    font-size: 9px;
}

    .broracing-howtoplay-content-wrapper blockquote p {
        margin: 0;
        color: #fef08a;
        font-size: 9px;
    }

/* ĐƯỜNG GẠCH PHÂN CHIA HR */
.broracing-howtoplay-content-wrapper hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin: 12px 0;
}

/* ==========================================================================
   TÙY CHỈNH THANH CUỘN (SCROLLBAR) CHUẨN PIXEL GAMING
   ========================================================================== */
.broracing-howtoplay-content-wrapper::-webkit-scrollbar {
    width: 6px;
}

.broracing-howtoplay-content-wrapper::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 4px;
}

.broracing-howtoplay-content-wrapper::-webkit-scrollbar-thumb {
    background: #00f0ff;
    border-radius: 4px;
    box-shadow: 0 0 6px rgba(0, 240, 255, 0.5);
}

    .broracing-howtoplay-content-wrapper::-webkit-scrollbar-thumb:hover {
        background: #facc15;
        box-shadow: 0 0 8px rgba(250, 204, 21, 0.8);
    }