:root {
    --bg-body: #0f212e;
    --bg-panel: #1a2c38;
    --bg-sidebar: #213743;
    --bg-input: #0f212e;
    --bg-cell-empty: #2f4553;

    --neon-green: #00e701;
    --neon-red: #e9113c;

    --text-primary: #ffffff;
    --text-secondary: #b1bad3;
    --text-dark: #0f212e;

    --primary-font: 'Inter', -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body,
html {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: var(--primary-font);
    display: flex;
    flex-direction: column;
    height: 100dvh;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* NAVBAR */
#navbar {
    width: 100%;
    height: 60px;
    background: var(--bg-panel);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
}

.nav-logo {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.text-green {
    color: var(--neon-green);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

#balance-container {
    display: flex;
    align-items: center;
    background: var(--bg-body);
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: transform 0.15s;
}

#balance-container.pop {
    color: var(--neon-green);
}

.currency {
    color: var(--text-secondary);
    margin-right: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* UTILS */
.hidden {
    display: none !important;
}

.w-100 {
    width: 100%;
}

/* BUTTONS */
.btn-primary {
    background: var(--neon-green);
    color: var(--text-dark);
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:hover {
    filter: brightness(1.1);
}

.btn-cashout {
    background: var(--neon-red);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.btn-cashout:active {
    transform: scale(0.98);
}

.btn-cashout:hover {
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--bg-cell-empty);
    color: var(--text-secondary);
    border: none;
    padding: 10px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.btn-secondary:active {
    transform: scale(0.98);
}

.btn-secondary:hover {
    background: #3f5869;
    color: #fff;
}

.btn-profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-body);
    border: 2px solid var(--bg-cell-empty);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    margin-left: 12px;
}

.btn-profile-avatar:hover {
    background: var(--bg-panel);
    color: #fff;
    border-color: var(--neon-green);
}

/* LAYOUT */
#main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 24px;
    overflow-y: auto;
}

.casino-dashboard {
    display: flex;
    flex-direction: row;
    width: 100%;
    max-width: 1000px;
    height: 90vh;
    max-height: 850px;
    background: var(--bg-panel);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.bet-sidebar {
    width: 300px;
    background: var(--bg-sidebar);
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.game-board-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: var(--bg-panel);
}

/* Sidebar Specifics */
.sidebar-section {
    margin-bottom: 20px;
}

.sidebar-label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

.bet-input-group {
    background: var(--bg-input);
    display: flex;
    align-items: center;
    border-radius: 4px;
    overflow: hidden;
    padding-right: 4px;
    border: 1px solid transparent;
    transition: border-color 0.2s;
}

.bet-input-group:focus-within {
    border-color: #3f5869;
}

.currency-badge {
    padding: 0 12px;
    color: var(--text-secondary);
    font-weight: 600;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
}

#bet-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    padding: 12px 4px;
    outline: none;
    font-weight: 600;
    font-family: inherit;
    font-size: 0.95rem;
    min-width: 0;
    appearance: none;
}

.bet-multipliers {
    display: flex;
    gap: 4px;
}

.btn-util {
    background: var(--bg-cell-empty);
    border: none;
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: 2px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.15s;
    font-size: 0.75rem;
}

.btn-util:hover {
    background: #3f5869;
    color: #fff;
}

.bet-quick-opts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.profit-display {
    margin-top: auto;
    margin-bottom: 20px;
    background: var(--bg-input);
    padding: 16px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s;
}

.profit-display.loss .profit-label {
    color: var(--text-secondary);
}

.profit-display.loss strong {
    color: var(--neon-red) !important;
}

.profit-display.win .profit-label {
    color: var(--neon-green);
}

.profit-display.win strong {
    color: var(--neon-green) !important;
}

.profit-label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    transition: color 0.2s;
}

#session-profit {
    font-size: 1.25rem;
    font-weight: 700;
    transition: color 0.2s;
}

.btn-massive {
    padding: 16px;
    font-size: 1rem;
}

/* Responsive Premium Mobile */
@media (max-width: 768px) {

    body,
    html {
        overflow-y: auto;
        overflow-x: hidden;
        touch-action: pan-y;
    }

    #navbar {
        padding: 0 15px;
        height: 60px;
    }

    .nav-logo {
        font-size: 1.15rem;
    }

    #main-content {
        padding: 0;
        display: block;
        overflow: visible;
    }

    .casino-dashboard {
        flex-direction: column;
        display: flex;
        height: auto;
        max-height: none;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }

    /* Desempacotando a Sidebar para Ordenação Flexível */
    .bet-sidebar {
        display: contents;
    }

    /* Segmentos individuais herdam um design "FLAT" limpo sem caixas */
    .sidebar-section {
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 15px !important;
        margin: 0 0 20px 0 !important;
    }

    .profit-display {
        background: transparent !important;
        box-shadow: none !important;
        margin: 10px 15px !important;
        padding: 20px 0 !important;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    #bet-action-container {
        margin: 20px 15px 30px 15px !important;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    /* 1. JOGO NO TOPO (CLEAN FLAT BACKGROUND) */
    .game-board-area {
        order: 1;
        flex: none;
        height: auto;
        background: transparent !important;
        border-radius: 0;
        padding: 20px 10px 30px 10px;
        box-shadow: none !important;
        z-index: 10;
        margin-bottom: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    #playfield-container {
        padding: 0;
        min-height: unset;
        aspect-ratio: 1/1;
        width: 95vw;
        max-width: 450px;
        margin: 0 auto;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #grid {
        width: 100%;
        height: 100%;
        padding: 4px;
        gap: 3px;
        border-radius: 8px;
        box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
    }

    #dock-container {
        height: auto;
        min-height: 90px;
        padding: 20px 5px 0 5px;
        background: transparent;
        justify-content: center;
        gap: 12px;
    }

    .dock-slot {
        width: 22vw;
        max-width: 80px;
        background: var(--bg-body);
        border-radius: 8px;
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
    }

    /* 2. POT DA RODADA E BOTOES DE ACAO */
    .profit-display {
        order: 2;
        margin-top: 5px !important;
    }

    #bet-action-container {
        order: 3;
    }

    /* 3. AREA DE APOSTAS LOGO ABAIXO DO POT E BOTOES */
    #mobile-bet-input {
        order: 4;
        margin-top: 15px !important;
    }

    #mobile-bet-presets {
        order: 5;
    }

    /* 4. GANHOS RECENTES NO FIM DA PAJINA */
    #mobile-live-feed {
        order: 6;
        margin-top: 20px !important;
        margin-bottom: 50px !important;
        height: 350px;
    }

    /* Modais (Carteira, PIX) */
    .modal-card {
        width: 92%;
        padding: 24px 20px;
        border-radius: 16px;
    }

    .wallet-modal-premium {
        width: 92%;
        max-width: 100%;
        border-radius: 16px;
    }

    .wallet-modal-header {
        padding: 18px 20px;
    }

    .wallet-content {
        padding: 20px 15px;
    }

    .btn-primary-massive {
        border-radius: 12px;
    }

    #pix-modal-layer .wallet-modal-premium {
        width: 92%;
    }

    /* Fix: Game over overlay cobrindo tela inteira no mobile */
    #game-over-overlay {
        position: fixed;
        inset: 0;
        z-index: 3000;
    }

    /* Fix: Admin tables responsivas */
    #admin-layer .wallet-modal-premium {
        max-height: 90vh;
        overflow-y: auto;
    }

    #admin-layer table {
        font-size: 0.75rem;
    }

    #admin-layer th,
    #admin-layer td {
        padding: 8px 6px !important;
    }

    /* Fix: Prevenir zoom automático no iOS em inputs */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"] {
        font-size: 16px !important;
    }

    /* Fix: Profile modal max-height adaptativo */
    #profile-layer .wallet-modal-premium {
        max-height: 90vh;
        overflow-y: auto;
    }

    #profile-layer .wallet-view.profile-view {
        max-height: 250px;
    }
}

/* HUD inside game */
#multiplier-display {
    display: none !important;
}

/* PLAYFIELD */
#playfield-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    min-height: 0;
}

#grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 4px;
    height: 100%;
    max-width: 100%;
    aspect-ratio: 1;
    background: var(--bg-input);
    border-radius: 4px;
    padding: 8px;
}

.cell {
    background: var(--bg-cell-empty);
    border-radius: 4px;
    position: relative;
    transition: background 0.15s ease;
}

.cell.hover {
    background: #3f5869;
}

/* PIECES AND FILLED CELLS (Premium Tactile 3D Blocks) */
.piece-block,
.cell.filled {
    position: relative;
    border-radius: 4px;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 2px 1px rgba(255, 255, 255, 0.4),
        inset 0 -4px 0 rgba(0, 0, 0, 0.3);
}

.piece-block {
    width: 100%;
    height: 100%;
}

.cell.filled::after,
.piece-block::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, 0.1) 100%);
    pointer-events: none;
}

/* Palette Classes - Stake Flat Clean Colors */
.color-green {
    background: #00e701;
}

.color-yellow {
    background: #ffb800;
}

.color-blue {
    background: #00a2ff;
}

.color-purple {
    background: #b64cf5;
}

.color-orange {
    background: #ff6800;
}

.color-red {
    background: #e9113c;
}

/* DOCK */
#dock-container {
    flex-shrink: 0;
    height: 140px;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    padding: 16px;
    background: var(--bg-input);
}

.dock-slot {
    width: 25%;
    max-width: 110px;
    aspect-ratio: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-panel);
    border-radius: 4px;
}

.draggable-piece {
    position: absolute;
    display: grid;
    gap: 2px;
    z-index: 100;
    pointer-events: auto;
    transition: transform 0.1s ease;
    cursor: grab;
    touch-action: none;
    /* Bloqueia o navegador de puxar a tela pra baixo durante o toque */
}

.draggable-piece:active {
    cursor: grabbing;
}

.draggable-piece.dragging {
    opacity: 0.95;
    transform: scale(1.1) translateY(-15px);
    z-index: 2000;
}

.draggable-piece.inactive {
    opacity: 0.15;
    pointer-events: none;
    filter: grayscale(1);
    transform: scale(0.9);
}

/* MODALS UI */
@keyframes pulselight-fast {
    0% {
        filter: drop-shadow(0 0 2px #ff5555);
        transform: scale(1);
    }

    50% {
        filter: drop-shadow(0 0 10px #ff5555);
        transform: scale(1.05);
    }

    100% {
        filter: drop-shadow(0 0 2px #ff5555);
        transform: scale(1);
    }
}

#auth-layer,
#wallet-layer,
#profile-layer,
#pix-modal-layer,
#deposit-wall-layer {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(15, 33, 46, 0.8);
    transition: opacity 0.3s;
}

#game-over-overlay {
    position: absolute;
    inset: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(15, 33, 46, 0.85);
}

.modal-card {
    background: var(--bg-panel);
    width: 90%;
    max-width: 400px;
    padding: 32px;
    border-radius: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.modal-header {
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.modal-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 8px;
}

/* INPUTS */
.input-group {
    margin-bottom: 12px;
}

.input-group input {
    width: 100%;
    background: var(--bg-input);
    border: none;
    color: white;
    padding: 14px;
    font-family: inherit;
    font-size: 0.95rem;
    border-radius: 4px;
    outline: none;
}

.input-group input:focus {
    background: var(--bg-body);
}

.auth-switch {
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-switch span {
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.auth-switch span:hover {
    color: var(--neon-green);
}

/* PREMIUM LOGIN CARD */
.premium-login-card {}

.promo-banner {
    background: rgba(0, 231, 1, 0.1);
    color: var(--text-primary);
    padding: 12px;
    font-size: 0.9rem;
    border-radius: 4px;
    margin-bottom: 20px;
}

.promo-banner strong {
    color: var(--neon-green);
    font-size: 1rem;
}

/* PREMIUM WALLET / STAKE STYLE */
.wallet-modal-premium {
    background: var(--bg-sidebar);
    width: 100%;
    max-width: 440px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.wallet-modal-header {
    background: var(--bg-panel);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wallet-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.wallet-title svg {
    color: var(--text-secondary);
    width: 20px;
    height: 20px;
}

.btn-icon-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    border-radius: 4px;
}

.btn-icon-close:hover {
    color: #fff;
}

.wallet-tab-container {
    padding: 20px 24px 0 24px;
}

.wallet-tabs-pill {
    display: flex;
    background: var(--bg-input);
    border-radius: 4px;
    padding: 4px;
}

.wallet-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    font-family: inherit;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
}

.wallet-tab:hover {
    color: #fff;
}

.wallet-tab.active {
    background: var(--bg-cell-empty);
    color: #fff;
}

.wallet-content {
    padding: 24px;
    text-align: left;
}

.wallet-view.hidden {
    display: none !important;
}

.payment-method-box {
    background: var(--bg-panel);
    border-radius: 4px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    margin-bottom: 24px;
}

.method-badge {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.method-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pix-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 180, 164, 0.1);
    padding: 8px;
    border-radius: 4px;
}

.method-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
}

/* GLOBAL TOAST NOTIFICATION */
#global-toast {
    position: fixed;
    top: -100px;
    /* Hidden above */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 20, 25, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    font-weight: 600;
    font-size: 0.95rem;
    backdrop-filter: blur(10px);
    transition: top 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 90%;
    text-align: center;
}

#global-toast.show {
    top: 75px;
}

/* PIX KEY TYPE SELECTOR */
.pix-key-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.pix-key-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--bg-cell-empty);
    color: var(--text-secondary);
    padding: 16px 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: inherit;
}

.pix-key-option:hover {
    background: var(--bg-cell-empty);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.1);
}

.pix-key-option.active {
    background: rgba(0, 231, 1, 0.05);
    color: #fff;
    border-color: var(--neon-green);
    box-shadow: 0 5px 15px rgba(0, 231, 1, 0.15);
    transform: translateY(-2px);
}

.pix-key-option svg {
    flex-shrink: 0;
    opacity: 0.6;
    transition: all 0.2s;
    width: 24px;
    height: 24px;
}

.pix-key-option.active svg {
    opacity: 1;
    color: var(--neon-green);
}

/* SYMMETRY FIX: All stats values must have the same font size and professional look */
.stat-item .stat-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
}

/* PIX Input Box with Icon */
.pix-input-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--bg-cell-empty);
    border-radius: 8px;
    transition: all 0.2s;
}

.pix-key-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0 0 14px;
    color: var(--text-secondary);
    transition: color 0.2s;
}

/* PIX Character Counter */
.pix-char-counter {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s;
}

.pix-char-counter.valid {
    color: var(--neon-green);
}

.pix-char-counter.invalid {
    color: var(--neon-red);
}

/* PIX Validation Message */
.pix-validation-msg {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    min-height: 18px;
    transition: color 0.2s;
}

.pix-validation-msg.valid {
    color: var(--neon-green);
}

.pix-validation-msg.invalid {
    color: var(--neon-red);
}

#global-toast.error {
    border-left: 4px solid var(--neon-red);
}

#global-toast.success {
    border-left: 4px solid var(--neon-green);
}

#global-toast.info {
    border-left: 4px solid var(--neon-gold);
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.input-label {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.premium-input-group {
    display: flex;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}

.premium-input-group input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    outline: none;
}

.currency-prefix {
    background: transparent;
    padding: 0 0 0 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
}

.amount-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 24px;
}

.btn-preset {
    background: var(--bg-panel);
    border: none;
    color: var(--text-secondary);
    padding: 12px 0;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
    font-size: 0.85rem;
}

.btn-preset:hover {
    background: var(--bg-cell-empty);
    color: #fff;
}

.btn-primary-massive {
    background: var(--neon-green);
    color: var(--text-dark);
    width: 100%;
    padding: 16px;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
}

.btn-primary-massive:active {
    transform: scale(0.98);
}

.btn-primary-massive:hover {
    filter: brightness(1.1);
}

.btn-locked {
    background: #333 !important;
    color: #777 !important;
    cursor: not-allowed !important;
    pointer-events: none;
    border: 2px dashed #444;
}

.balance-card {
    background: var(--bg-panel);
    border-radius: 4px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.balance-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.balance-value {
    color: #fff;
    font-size: 1.8rem;
    font-weight: 700;
}

.history-container {
    display: none;
}

.text-green {
    color: var(--neon-green);
}

.text-red {
    color: var(--neon-red);
}

/* HISTORY LISTS */
.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    background: var(--bg-body);
    border-radius: 4px;
    padding: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 3px solid var(--bg-cell-empty);
}

.history-item.win,
.history-item.deposit {
    border-left-color: var(--neon-green);
}

.history-item.loss,
.history-item.withdraw {
    border-left-color: var(--neon-red);
}

.history-item-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
}

.history-item-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.history-item-amount {
    font-size: 1rem;
    font-weight: 700;
}

.history-item-amount.pos {
    color: var(--neon-green);
}

.history-item-amount.neg {
    color: var(--neon-red);
}

/* GAME OVER CARDS specifics */
.game-over-card {
    background: var(--bg-sidebar);
    padding: 32px 24px;
    border-radius: 16px;
    width: 320px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: slideUpGameOver 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes slideUpGameOver {
    0% {
        transform: scale(0.5) translateY(100px);
        opacity: 0;
        filter: blur(10px);
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
        filter: blur(0);
    }
}

.go-header {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.go-multiplier {
    font-weight: 600;
    font-size: 1.2rem;
    background: var(--bg-panel);
    padding: 6px 12px;
    border-radius: 4px;
    color: var(--text-secondary);
}

.go-multiplier.win {
    color: var(--neon-green);
}

.go-multiplier.loss {
    color: var(--neon-red);
}

.go-status {
    font-size: 1.3rem;
    margin: 0;
    font-weight: 700;
    text-align: center;
    color: #fff;
}

.go-body {
    background: var(--bg-panel);
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 24px;
    text-align: center;
}

.go-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 8px;
}

.round-profit {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.profit-pos {
    color: var(--neon-green);
}

.profit-neg {
    color: var(--neon-red);
}

.btn-go-close {
    padding: 14px;
    font-size: 1rem;
}

/* ANIMATIONS & EFFECTS */
.pulse {
    animation: none;
}

.pulse {
    animation: none;
}

.line-clear-glow {
    animation: blockDissolve 0.5s ease-out forwards;
    z-index: 20;
    position: relative;
}

@keyframes blockDissolve {
    0% {
        filter: brightness(1.2);
        box-shadow: inset 0 0 10px var(--neon-green);
        transform: scale(1);
    }

    30% {
        filter: brightness(2);
        background: #ccffcc;
        box-shadow: inset 0 0 20px var(--neon-green);
        transform: scale(0.9);
        border-radius: 8px;
    }

    100% {
        filter: brightness(1);
        transform: scale(0.2);
        opacity: 0;
        box-shadow: inset 0 0 0 transparent;
        border-radius: 12px;
    }
}

.shake {
    animation: intenseShake 0.4s ease-out both;
}

@keyframes intenseShake {

    10%,
    90% {
        transform: translate3d(-1px, 1px, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, -1px, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-2px, 2px, 0);
    }

    40%,
    60% {
        transform: translate3d(2px, -2px, 0);
    }
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    background: #00e701;
    box-shadow: 0 0 10px #00e701;
    animation: floatUp 1.2s ease-out forwards;
}

.particle.coin {
    background: #ffd700;
    box-shadow: 0 0 8px #ff8c00;
    width: 6px !important;
    height: 6px !important;
    animation: floatUp 1.5s ease-out forwards;
}

#feedback-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 99999;
}

@keyframes floatUp {
    0% {
        transform: translate(0, 0) scale(0);
        opacity: 0;
    }

    20% {
        transform: translate(calc(var(--tx) * 0.5), calc(var(--ty) * 0.5 - 20px)) scale(1.5);
        opacity: 1;
    }

    100% {
        transform: translate(var(--tx), calc(var(--ty) - 100px)) scale(0);
        opacity: 0;
    }
}

/* Fortune Tiger / Blaze Big Win Overlay */
.big-win-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle, rgba(234, 179, 8, 0.25) 0%, rgba(0, 0, 0, 0.88) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: overlayFadeIn 0.3s forwards;
    pointer-events: all;
    backdrop-filter: blur(5px);
}

.big-win-overlay.closing {
    animation: overlayFadeOut 0.5s ease-in forwards;
}

@keyframes overlayFadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes overlayFadeOut {
    0% {
        opacity: 1;
        filter: blur(0);
        transform: scale(1);
    }

    100% {
        opacity: 0;
        filter: blur(15px);
        transform: scale(1.2);
    }
}

.big-win-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 900;
    text-transform: uppercase;
    color: #ffd700;
    text-shadow:
        0 4px 0 #b38600,
        0 10px 20px rgba(0, 0, 0, 0.9),
        0 0 40px #ff8c00;
    -webkit-text-stroke: 1px #fff;
    animation: zoomTitle 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
               floatTitle 3s ease-in-out infinite 0.5s;
    margin-bottom: 20px;
    letter-spacing: 2px;
    position: relative;
    z-index: 99998;
}

@keyframes floatTitle {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(1.5deg); }
}

@keyframes zoomTitle {
    0% { transform: scale(0.1) rotate(-15deg) translateY(100px); opacity: 0; filter: blur(10px); }
    50% { transform: scale(1.2) rotate(5deg) translateY(-20px); filter: brightness(1.5) blur(0); }
    100% { transform: scale(1) rotate(0deg) translateY(0); opacity: 1; filter: brightness(1); }
}

.sunburst-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 250vw;
    height: 250vw;
    margin-left: -125vw;
    margin-top: -125vw;
    background: repeating-conic-gradient(transparent 0deg,
            rgba(255, 215, 0, 0.25) 10deg,
            transparent 20deg);
    animation: spinRays 30s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes spinRays {
    100% {
        transform: rotate(360deg);
    }
}

.big-win-amount {
    font-size: clamp(3rem, 10vw, 5.5rem);
    font-weight: 900;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.9), 0 0 50px rgba(74, 222, 128, 0.5);
    -webkit-text-stroke: 1px #14532d;
    background: -webkit-linear-gradient(#bbf7d0, #22c55e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    animation: popAmount 0.5s ease forwards 0.2s;
    font-family: inherit;
    position: relative;
    z-index: 2;
}

@keyframes popAmount {
    0% {
        transform: scale(0.1) translateY(100px);
        opacity: 0;
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.big-win-amount.rolling {
    filter: brightness(1.5) contrast(1.2);
}

.big-win-amount.pulse-finish {
    opacity: 1;
    animation: 
        massiveExplode 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.3) forwards,
        heartbeatAmount 0.8s ease-in-out infinite alternate 0.5s;
}

@keyframes massiveExplode {
    0% { transform: scale(1); filter: brightness(1) drop-shadow(0 0 0 transparent); }
    40% { transform: scale(1.35) rotate(-2deg); filter: brightness(2) drop-shadow(0 0 20px #fff); }
    100% { transform: scale(1.05) rotate(0deg); filter: brightness(1.1) drop-shadow(0 0 0 transparent); }
}

@keyframes heartbeatAmount {
    0% {
        transform: scale(1.05);
        text-shadow: 0 0 30px rgba(34, 197, 94, 0.5);
    }

    100% {
        transform: scale(1.1);
        text-shadow: 0 0 60px rgba(34, 197, 94, 1);
    }
}

.rain-coin {
    position: fixed;
    top: -50px;
    width: clamp(25px, 5vw, 40px);
    height: clamp(25px, 5vw, 40px);
    background: radial-gradient(circle, #fcd34d 0%, #d97706 100%);
    border: 3px solid #fef08a;
    border-radius: 50%;
    z-index: 99998;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.8);
    pointer-events: none;
    animation: rainDrop 2s linear forwards;
}

@keyframes rainDrop {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(120vh) rotate(1080deg);
        opacity: 1;
    }
}

/* Small Win Toast */
.small-win-toast {
    position: absolute;
    left: 50%;
    top: 40%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.95), rgba(21, 128, 61, 0.98));
    padding: 12px 30px;
    border-radius: 50px;
    color: #fff;
    font-weight: 800;
    font-size: 1.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), inset 0 0 12px rgba(255, 255, 255, 0.3);
    border: 2px solid #4ade80;
    pointer-events: none;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: flyUpToast 1.5s cubic-bezier(0.175, 0.885, 0.32, 1) forwards;
}

.small-win-toast .val {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    font-family: monospace;
    letter-spacing: -1px;
}

@keyframes flyUpToast {
    0% {
        transform: translate(-50%, 0) scale(0);
        opacity: 0;
        filter: blur(0);
    }

    15% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
        filter: blur(0);
    }

    25% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        filter: blur(0);
    }

    80% {
        transform: translate(-50%, -120%) scale(1);
        opacity: 1;
        filter: blur(0);
    }

    100% {
        transform: translate(-50%, -180%) scale(0.8);
        opacity: 0;
        filter: blur(6px);
    }
}

.money-counting-glow {
    animation: goldPulse 0.5s infinite alternate;
}

@keyframes goldPulse {
    0% {
        transform: scale(1);
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
        color: #ffd700;
    }

    100% {
        transform: scale(1.05);
        text-shadow: 0 0 25px rgba(255, 215, 0, 1);
        color: #fff;
    }
}