/* === Bingo Machine === */
.bg-container {
    max-width: 860px;
    margin: 0 auto;
    font-family: 'Segoe UI', system-ui, sans-serif
}

/* Tabs */
.bg-tabs {
    display: flex;
    gap: 0;
    margin: 0 0 0;
    background: linear-gradient(180deg, #1a1a2e, #16213e);
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    border: 2px solid #0f3460;
    border-bottom: none
}

.bg-tab {
    flex: 1;
    text-align: center;
    padding: 14px 12px;
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, .5);
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all .2s
}

.bg-tab.active {
    color: #fbbf24;
    border-bottom-color: #fbbf24;
    background: rgba(251, 191, 36, .08)
}

.bg-tab:hover {
    color: #fbbf24;
    background: rgba(251, 191, 36, .05)
}

.bg-tab-panel {
    display: none
}

.bg-tab-panel.active {
    display: block
}

/* Casino stage area */
.bg-stage {
    background: linear-gradient(180deg, #16213e, #1a1a2e 40%, #0d1117);
    border-left: 2px solid #0f3460;
    border-right: 2px solid #0f3460;
    border-bottom: 2px solid #0f3460;
    border-radius: 0 0 12px 12px;
    padding-bottom: 4px
}

/* All tab panels get dark bg except bingo which uses bg-stage */
#bg-panel-custom,
#bg-panel-cards {
    background: linear-gradient(180deg, #16213e, #1a1a2e 40%, #0d1117);
    border-left: 2px solid #0f3460;
    border-right: 2px solid #0f3460;
    border-bottom: 2px solid #0f3460;
    border-radius: 0 0 12px 12px
}

/* Settings */
.bg-settings {
    padding: 16px 20px;
    margin-bottom: 0
}

.bg-setting-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap
}

.bg-setting-label {
    font-size: 14px;
    color: rgba(255, 255, 255, .7);
    font-weight: 600;
    min-width: 60px
}

.bg-radio-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap
}

.bg-radio-group label {
    font-size: 13px;
    color: rgba(255, 255, 255, .7);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600
}

.bg-radio-group input[type="radio"] {
    accent-color: #fbbf24;
    width: 16px;
    height: 16px
}

.bg-range-input {
    width: 80px;
    padding: 5px 8px;
    border: 2px solid #334155;
    border-radius: 8px;
    font-size: 14px;
    color: #fbbf24;
    text-align: center;
    background: rgba(255, 255, 255, .08)
}

.bg-range-input:focus {
    outline: none;
    border-color: #fbbf24
}

.bg-toggle-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center
}

.bg-toggle-label {
    font-size: 13px;
    color: rgba(255, 255, 255, .7);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600
}

.bg-toggle-label input[type="checkbox"] {
    accent-color: #fbbf24;
    width: 16px;
    height: 16px
}

.bg-vol-slider {
    width: 100px;
    accent-color: #fbbf24
}

/* Drum display */
.bg-drum-area {
    text-align: center;
    padding: 32px 16px 20px;
    position: relative
}

.bg-drum-outer {
    display: inline-block;
    position: relative;
    padding: 14px
}

.bg-drum-outer::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid rgba(251, 191, 36, .15);
    animation: bgOuterRotate 12s linear infinite
}

.bg-drum-outer::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    border: 2px dashed rgba(251, 191, 36, .1)
}

@keyframes bgOuterRotate {
    to {
        transform: rotate(360deg)
    }
}

/* Sparkle decorations */
.bg-drum-area .bg-sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #fbbf24;
    border-radius: 50%;
    animation: bgSparkle 2s ease-in-out infinite;
    pointer-events: none
}

.bg-drum-area .bg-sparkle:nth-child(1) {
    top: 15%;
    left: 10%;
    animation-delay: 0s
}

.bg-drum-area .bg-sparkle:nth-child(2) {
    top: 25%;
    right: 8%;
    animation-delay: .5s
}

.bg-drum-area .bg-sparkle:nth-child(3) {
    bottom: 20%;
    left: 15%;
    animation-delay: 1s
}

.bg-drum-area .bg-sparkle:nth-child(4) {
    bottom: 30%;
    right: 12%;
    animation-delay: 1.5s
}

@keyframes bgSparkle {

    0%,
    100% {
        opacity: 0;
        transform: scale(.5)
    }

    50% {
        opacity: .8;
        transform: scale(1.2)
    }
}

.bg-drum-box {
    display: inline-flex;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #3d2580 0%, #2d1b69 30%, #1a0a3e 60%, #0d0520 100%);
    border: 5px solid #fbbf24;
    box-shadow:
        0 0 0 8px rgba(251, 191, 36, .08),
        0 0 40px rgba(251, 191, 36, .2),
        0 0 80px rgba(251, 191, 36, .08),
        inset 0 -20px 40px rgba(0, 0, 0, .4),
        inset 0 20px 40px rgba(251, 191, 36, .08),
        0 12px 40px rgba(0, 0, 0, .5);
    position: relative;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    margin: 0 auto
}

.bg-drum-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent 0%, rgba(251, 191, 36, .04) 25%, transparent 50%, rgba(251, 191, 36, .04) 75%, transparent 100%);
    animation: bgGlow 8s linear infinite
}

.bg-drum-box::after {
    content: '';
    position: absolute;
    top: 8%;
    left: 20%;
    width: 35%;
    height: 20%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, .12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none
}

@keyframes bgGlow {
    to {
        transform: rotate(360deg)
    }
}

.bg-drum-box.spinning-active {
    box-shadow:
        0 0 0 8px rgba(251, 191, 36, .15),
        0 0 50px rgba(251, 191, 36, .4),
        0 0 100px rgba(251, 191, 36, .15),
        inset 0 -20px 40px rgba(0, 0, 0, .4),
        inset 0 0 50px rgba(251, 191, 36, .25),
        0 12px 40px rgba(0, 0, 0, .5);
    animation: bgDrumPulse .5s ease infinite alternate
}

@keyframes bgDrumPulse {
    from {
        box-shadow: 0 0 50px rgba(251, 191, 36, .4), 0 0 100px rgba(251, 191, 36, .15), inset 0 0 40px rgba(251, 191, 36, .2), 0 12px 40px rgba(0, 0, 0, .5)
    }

    to {
        box-shadow: 0 0 60px rgba(251, 191, 36, .5), 0 0 120px rgba(251, 191, 36, .2), inset 0 0 50px rgba(251, 191, 36, .25), 0 12px 40px rgba(0, 0, 0, .5)
    }
}

.bg-drum-letter {
    font-size: 22px;
    font-weight: 800;
    color: #fbbf24;
    height: 26px;
    line-height: 26px;
    text-shadow: 0 0 10px rgba(251, 191, 36, .5);
    position: relative;
    z-index: 1
}

.bg-drum-number {
    font-size: 80px;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    transition: transform .1s;
    user-select: none;
    text-shadow: 0 2px 20px rgba(251, 191, 36, .4), 0 0 40px rgba(251, 191, 36, .2);
    position: relative;
    z-index: 1
}

.bg-drum-number.spinning {
    animation: bgSpin .06s linear infinite;
    color: #fbbf24
}

@keyframes bgSpin {
    0% {
        transform: translateY(-10px) scaleY(1.1);
        opacity: .4
    }

    50% {
        transform: translateY(0);
        opacity: .9
    }

    100% {
        transform: translateY(10px) scaleY(1.1);
        opacity: .4
    }
}

.bg-drum-number.pop {
    animation: bgPop .5s cubic-bezier(.175, .885, .32, 1.275)
}

@keyframes bgPop {
    0% {
        transform: scale(.2) rotate(-10deg);
        opacity: 0
    }

    50% {
        transform: scale(1.2) rotate(3deg)
    }

    100% {
        transform: scale(1) rotate(0);
        opacity: 1
    }
}

.bg-drum-sub {
    font-size: 13px;
    color: rgba(251, 191, 36, .7);
    margin-top: 6px;
    font-weight: 600;
    position: relative;
    z-index: 1
}

/* Draw button */
.bg-draw-wrap {
    text-align: center;
    padding: 16px 16px 12px
}

.bg-draw-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706, #b45309);
    color: #fff;
    border: none;
    padding: 16px 56px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 14px;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 4px 15px rgba(245, 158, 11, .35), inset 0 1px 0 rgba(255, 255, 255, .2);
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .3)
}

.bg-draw-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(245, 158, 11, .5), inset 0 1px 0 rgba(255, 255, 255, .2)
}

.bg-draw-btn:active {
    transform: translateY(0)
}

.bg-draw-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none
}

.bg-draw-btn.bg-stop {
    background: linear-gradient(135deg, #ef4444, #dc2626, #b91c1c);
    box-shadow: 0 4px 15px rgba(239, 68, 68, .4), inset 0 1px 0 rgba(255, 255, 255, .2);
    animation: bgStopPulse 1s ease infinite
}

@keyframes bgStopPulse {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(239, 68, 68, .4)
    }

    50% {
        box-shadow: 0 4px 25px rgba(239, 68, 68, .6)
    }
}

/* Remaining count */
.bg-remaining {
    text-align: center;
    font-size: 14px;
    color: rgba(255, 255, 255, .5);
    padding: 8px;
    font-weight: 600
}

.bg-remaining strong {
    color: #fbbf24;
    font-size: 16px
}

/* Recent history */
.bg-history {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    flex-wrap: wrap;
    min-height: 50px;
    align-items: center
}

.bg-history-ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .3), inset 0 -2px 4px rgba(0, 0, 0, .15), inset 0 2px 4px rgba(255, 255, 255, .2)
}

.bg-history-ball.bg-col-b {
    background: radial-gradient(circle at 35% 35%, #60a5fa, #2563eb)
}

.bg-history-ball.bg-col-i {
    background: radial-gradient(circle at 35% 35%, #f87171, #dc2626)
}

.bg-history-ball.bg-col-n {
    background: radial-gradient(circle at 35% 35%, #fbbf24, #d97706)
}

.bg-history-ball.bg-col-g {
    background: radial-gradient(circle at 35% 35%, #34d399, #059669)
}

.bg-history-ball.bg-col-o {
    background: radial-gradient(circle at 35% 35%, #a78bfa, #7c3aed)
}

.bg-history-ball.bg-col-x {
    background: radial-gradient(circle at 35% 35%, #9ca3af, #4b5563)
}

/* Call board */
.bg-callboard-wrap {
    padding: 8px 16px 16px;
    margin: 0
}

.bg-callboard {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 3px;
    font-size: 12px;
    background: rgba(0, 0, 0, .2);
    border-radius: 10px;
    padding: 8px
}

.bg-cb-header {
    text-align: center;
    font-weight: 800;
    padding: 6px 2px;
    border-radius: 4px;
    color: #fff;
    font-size: 14px
}

.bg-cb-header.bg-h-b {
    background: #3b82f6
}

.bg-cb-header.bg-h-i {
    background: #ef4444
}

.bg-cb-header.bg-h-n {
    background: #f59e0b
}

.bg-cb-header.bg-h-g {
    background: #10b981
}

.bg-cb-header.bg-h-o {
    background: #8b5cf6
}

.bg-cb-cell {
    text-align: center;
    padding: 5px 2px;
    border-radius: 4px;
    font-weight: 600;
    color: rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .06);
    transition: all .3s;
    font-size: 12px
}

.bg-cb-cell.called {
    color: #fff;
    font-weight: 800;
    transform: scale(1.05)
}

.bg-cb-cell.called.bg-c-b {
    background: #3b82f6;
    border-color: #3b82f6
}

.bg-cb-cell.called.bg-c-i {
    background: #ef4444;
    border-color: #ef4444
}

.bg-cb-cell.called.bg-c-n {
    background: #f59e0b;
    border-color: #f59e0b
}

.bg-cb-cell.called.bg-c-g {
    background: #10b981;
    border-color: #10b981
}

.bg-cb-cell.called.bg-c-o {
    background: #8b5cf6;
    border-color: #8b5cf6
}

.bg-cb-cell.latest {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, .3), 0 0 0 4px currentColor, 0 0 12px currentColor;
    animation: bgLatestPulse 1s ease 3
}

@keyframes bgLatestPulse {

    0%,
    100% {
        box-shadow: 0 0 0 2px rgba(0, 0, 0, .3), 0 0 0 4px currentColor, 0 0 12px currentColor
    }

    50% {
        box-shadow: 0 0 0 2px rgba(0, 0, 0, .3), 0 0 0 6px currentColor, 0 0 20px currentColor
    }
}

/* Full history list */
.bg-full-history {
    padding: 8px 16px;
    margin-top: 8px
}

.bg-full-history-title {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, .5);
    margin-bottom: 6px;
    cursor: pointer;
    user-select: none
}

.bg-full-history-list {
    font-size: 12px;
    color: rgba(255, 255, 255, .6);
    line-height: 1.8;
    word-break: break-all
}

/* Action bar */
.bg-action-bar {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    flex-wrap: wrap
}

.bg-act-btn {
    background: rgba(251, 191, 36, .1);
    border: 1.5px solid rgba(251, 191, 36, .4);
    color: #fbbf24;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap
}

.bg-act-btn:hover {
    background: #fbbf24;
    color: #1a1a2e;
    border-color: #fbbf24
}

.bg-act-btn.bg-danger {
    border-color: rgba(239, 68, 68, .5);
    color: #f87171;
    background: rgba(239, 68, 68, .1)
}

.bg-act-btn.bg-danger:hover {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444
}

/* Custom bingo textarea */
.bg-textarea {
    width: 100%;
    min-height: 120px;
    border: 2px solid #334155;
    border-radius: 10px;
    padding: 12px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    background: rgba(255, 255, 255, .06);
    color: #e5e7eb
}

.bg-textarea:focus {
    outline: none;
    border-color: #fbbf24;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, .15)
}

.bg-textarea::placeholder {
    color: rgba(255, 255, 255, .35)
}

.bg-input-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    flex-wrap: wrap;
    gap: 8px
}

.bg-item-count {
    font-size: 14px;
    color: rgba(255, 255, 255, .6);
    font-weight: 600
}

.bg-item-count strong {
    color: #fbbf24
}

.bg-small-btn {
    background: rgba(251, 191, 36, .1);
    border: 1.5px solid #fbbf24;
    color: #fbbf24;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap
}

.bg-small-btn:hover {
    background: #fbbf24;
    color: #1a1a2e
}

.bg-small-btn.bg-danger {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, .1)
}

.bg-small-btn.bg-danger:hover {
    background: #ef4444;
    color: #fff
}

/* Custom item history */
.bg-custom-board {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 16px;
    justify-content: center
}

.bg-custom-ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    background: rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .4);
    border: 1px solid rgba(255, 255, 255, .12);
    transition: all .3s
}

.bg-custom-ball.called {
    background: linear-gradient(135deg, rgba(251, 191, 36, .2), rgba(253, 230, 138, .2));
    color: #fbbf24;
    border-color: #fbbf24
}

/* Card generator */
.bg-card-settings {
    padding: 16px;
    margin-bottom: 12px
}

.bg-card-settings .bg-setting-label {
    color: rgba(255, 255, 255, .7)
}

.bg-card-settings .bg-range-input {
    background: rgba(255, 255, 255, .08);
    border-color: #334155;
    color: #fbbf24
}

.bg-card-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    padding: 16px
}

.bg-bingo-card {
    border-collapse: collapse;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
    border-radius: 8px;
    overflow: hidden
}

.bg-bingo-card th {
    padding: 8px 14px;
    font-size: 16px;
    font-weight: 800;
    color: #fff
}

.bg-bingo-card th:nth-child(1) {
    background: #3b82f6
}

.bg-bingo-card th:nth-child(2) {
    background: #ef4444
}

.bg-bingo-card th:nth-child(3) {
    background: #f59e0b
}

.bg-bingo-card th:nth-child(4) {
    background: #10b981
}

.bg-bingo-card th:nth-child(5) {
    background: #8b5cf6
}

.bg-bingo-card td {
    border: 1px solid #e5e7eb;
    padding: 10px 14px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    background: #fff;
    min-width: 40px
}

.bg-bingo-card td.bg-free {
    background: #fef3c7;
    color: #d97706;
    font-size: 11px;
    font-weight: 800
}

/* Fullscreen mode */
.bg-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0d0d1a 100%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px
}

/* Fullscreen drum area */
.bg-fs-drum-area {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px
}

.bg-fs-drum-area .bg-sparkle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #fbbf24;
    border-radius: 50%;
    animation: bgSparkle 2s ease-in-out infinite;
    pointer-events: none
}

.bg-fs-drum-area .bg-sparkle:nth-child(1) {
    top: 5%;
    left: 15%;
    animation-delay: 0s
}

.bg-fs-drum-area .bg-sparkle:nth-child(2) {
    top: 15%;
    right: 10%;
    animation-delay: .5s
}

.bg-fs-drum-area .bg-sparkle:nth-child(3) {
    bottom: 10%;
    left: 20%;
    animation-delay: 1s
}

.bg-fs-drum-area .bg-sparkle:nth-child(4) {
    bottom: 20%;
    right: 15%;
    animation-delay: 1.5s
}

.bg-fs-drum-outer {
    display: inline-block;
    position: relative;
    padding: 16px
}

.bg-fs-drum-outer::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid rgba(251, 191, 36, .15);
    animation: bgOuterRotate 12s linear infinite
}

.bg-fs-drum-outer::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    border: 2px dashed rgba(251, 191, 36, .1)
}

.bg-fs-drum-box {
    display: inline-flex;
    width: min(55vmin, 380px);
    height: min(55vmin, 380px);
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #3d2580 0%, #2d1b69 30%, #1a0a3e 60%, #0d0520 100%);
    border: 5px solid #fbbf24;
    box-shadow:
        0 0 0 8px rgba(251, 191, 36, .08),
        0 0 40px rgba(251, 191, 36, .2),
        0 0 80px rgba(251, 191, 36, .08),
        inset 0 -20px 40px rgba(0, 0, 0, .4),
        inset 0 20px 40px rgba(251, 191, 36, .08),
        0 12px 40px rgba(0, 0, 0, .5);
    position: relative;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    flex-direction: column
}

.bg-fs-drum-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent 0%, rgba(251, 191, 36, .04) 25%, transparent 50%, rgba(251, 191, 36, .04) 75%, transparent 100%);
    animation: bgGlow 8s linear infinite
}

.bg-fs-drum-box::after {
    content: '';
    position: absolute;
    top: 8%;
    left: 20%;
    width: 35%;
    height: 20%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, .12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none
}

.bg-fs-drum-box.spinning-active {
    box-shadow:
        0 0 0 8px rgba(251, 191, 36, .15),
        0 0 50px rgba(251, 191, 36, .4),
        0 0 100px rgba(251, 191, 36, .15),
        inset 0 -20px 40px rgba(0, 0, 0, .4),
        inset 0 0 50px rgba(251, 191, 36, .25),
        0 12px 40px rgba(0, 0, 0, .5);
    animation: bgDrumPulse .5s ease infinite alternate
}

.bg-fs-drum-letter {
    font-size: min(5vmin, 36px);
    font-weight: 800;
    color: #fbbf24;
    height: 40px;
    line-height: 40px;
    text-shadow: 0 0 10px rgba(251, 191, 36, .5);
    position: relative;
    z-index: 1
}

.bg-fs-drum-number {
    font-size: min(22vmin, 140px);
    font-weight: 900;
    color: #fff;
    line-height: 1;
    text-shadow: 0 2px 20px rgba(251, 191, 36, .4), 0 0 40px rgba(251, 191, 36, .2);
    position: relative;
    z-index: 1;
    transition: transform .1s;
    user-select: none
}

.bg-fs-drum-number.spinning {
    animation: bgNumSpin .08s linear infinite
}

.bg-fs-drum-number.pop {
    animation: bgNumPop .35s ease-out
}

.bg-fs-drum-sub {
    font-size: min(3vmin, 18px);
    color: rgba(251, 191, 36, .7);
    font-weight: 600;
    position: relative;
    z-index: 1;
    margin-top: 4px
}

.bg-fs-sub {
    font-size: min(3vw, 20px);
    color: rgba(255, 255, 255, .5);
    font-weight: 600
}

.bg-fs-draw-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706, #b45309);
    color: #fff;
    border: none;
    padding: 16px 48px;
    font-size: min(4vw, 22px);
    font-weight: 700;
    border-radius: 14px;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 4px 20px rgba(245, 158, 11, .4), inset 0 1px 0 rgba(255, 255, 255, .2);
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
    margin-top: 8px
}

.bg-fs-draw-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(245, 158, 11, .5)
}

.bg-fs-draw-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none
}

.bg-fs-draw-btn.bg-stop {
    background: linear-gradient(135deg, #ef4444, #dc2626, #b91c1c);
    box-shadow: 0 4px 20px rgba(239, 68, 68, .4);
    animation: bgStopPulse 1s ease infinite
}

.bg-fs-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, .15);
    border: none;
    color: #fff;
    font-size: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: background .2s
}

.bg-fs-close:hover {
    background: rgba(255, 255, 255, .3)
}

.bg-fs-board {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 3px;
    max-width: 90vw;
    margin-top: 12px
}

.bg-fs-cell {
    text-align: center;
    padding: 4px 2px;
    border-radius: 3px;
    font-size: min(1.5vw, 14px);
    font-weight: 600;
    color: rgba(255, 255, 255, .25);
    background: rgba(255, 255, 255, .05)
}

.bg-fs-cell.called {
    color: #fff;
    font-weight: 800
}

.bg-fs-cell.called.bg-c-b {
    background: rgba(59, 130, 246, .7)
}

.bg-fs-cell.called.bg-c-i {
    background: rgba(239, 68, 68, .7)
}

.bg-fs-cell.called.bg-c-n {
    background: rgba(245, 158, 11, .7)
}

.bg-fs-cell.called.bg-c-g {
    background: rgba(16, 185, 129, .7)
}

.bg-fs-cell.called.bg-c-o {
    background: rgba(139, 92, 246, .7)
}

.bg-fs-header {
    text-align: center;
    font-weight: 800;
    padding: 4px 2px;
    border-radius: 3px;
    color: #fff;
    font-size: min(1.8vw, 16px)
}

/* Security banner */
.bg-security-banner {
    display: flex;
    gap: 16px;
    padding: 16px;
    margin: 16px;
    background: #fffbeb;
    border-radius: 12px;
    border: 2px solid #fde68a;
    flex-wrap: wrap
}

.bg-security-item {
    flex: 1;
    min-width: 130px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #4b5563
}

.bg-security-icon {
    font-size: 22px
}

.bg-security-item strong {
    color: #1f2937;
    display: block;
    font-size: 14px
}

.bg-security-item p {
    margin: 2px 0 0;
    font-size: 12px;
    color: #6b7280
}

/* Responsive */
@media(max-width:600px) {
    .bg-setting-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px
    }

    .bg-setting-label {
        min-width: auto
    }

    .bg-drum-box {
        width: 200px;
        height: 200px
    }

    .bg-drum-number {
        font-size: 56px
    }

    .bg-callboard {
        font-size: 10px
    }

    .bg-cb-cell {
        padding: 3px 1px;
        font-size: 10px
    }

    .bg-history-ball {
        width: 40px;
        height: 40px;
        font-size: 13px
    }

    .bg-security-banner {
        flex-direction: column;
        gap: 10px;
        margin: 12px 8px
    }

    .bg-draw-btn {
        width: 100%;
        padding: 14px
    }

    .bg-bingo-card td,
    .bg-bingo-card th {
        padding: 6px 8px;
        font-size: 13px
    }

    .bg-action-bar {
        flex-direction: column;
        align-items: stretch
    }

    .bg-act-btn {
        text-align: center
    }
}