/* RAP.GG — Carbon & Slate Style Theme (Bloxyspin Redesign) */

:root {
    --bg-main: #0c0d14;
    --bg-darker: #08090d;
    --bg-card: #141722;
    --border-color: rgba(255, 255, 255, 0.08);
    --purple: #00e5ff;
    --purple-glow: rgba(0, 229, 255, 0.4);
    --border-hover: rgba(0, 229, 255, 0.3);
    --purple-shadow: #00a4b8;
    
    --green: #10b981;
    --green-glow: rgba(16, 185, 129, 0.2);
    
    --red: #ef4444;
    --red-glow: rgba(239, 68, 68, 0.2);
    
    --orange: #f97316;
    --blue: #3b82f6;
    --text-white: #f3f4f6;
    --text-gray: #9ca3af;
    --text-dark: #4b5563;
}

/* Custom Glitch Logo Style */
.glitch-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 900;
    color: #fff;
    text-shadow: -1.5px 0 0 rgba(255,0,0,0.8), 1.5px 0 0 rgba(0,231,223,0.8);
    margin: 0;
    padding: 0;
    letter-spacing: 0px;
}
.glitch-logo span {
    color: #3b82f6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-white);
    overflow: hidden;
    height: 100vh;
}

.glow-effect {
    position: fixed;
    top: -20%;
    left: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, rgba(0,0,0,0) 70%);
    pointer-events: none;
    z-index: -1;
}

/* WORKSPACE LAYOUT */
.app-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* SIDEBAR */
.app-sidebar {
    width: 280px;
    background-color: var(--bg-darker);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 0;
    z-index: 10;
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}

.app-sidebar.collapsed {
    width: 76px;
}

.sidebar-logo {
    margin-bottom: 30px;
    text-align: center;
}

.logo-main {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 1px;
}

.logo-color {
    color: var(--purple);
    text-shadow: 0 0 15px var(--purple-glow);
}

.sidebar-balance {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 25px;
}

.balance-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-gray);
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.balance-display {
    font-size: 22px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-white);
    margin-bottom: 12px;
}

.balance-actions {
    display: flex;
    gap: 8px;
}

.btn-side {
    flex: 1;
    border: none;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-dep {
    background: var(--purple);
    color: #fff;
}

.btn-dep:hover {
    box-shadow: 0 0 10px var(--purple-glow);
}

.btn-with {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-white);
}

.btn-with:hover {
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    background: none;
    border: 1px solid transparent;
    color: var(--text-gray);
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-white);
}

.nav-item.active {
    background: rgba(139, 92, 246, 0.12);
    color: var(--text-white);
    border-color: rgba(139, 92, 246, 0.35);
}

.sidebar-footer {
    margin-top: auto;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.user-chip:hover {
    background: rgba(255,255,255,0.045);
    border-color: rgba(255,255,255,0.08);
}

.user-avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(255,255,255,0.15);
}

.user-name {
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
    overflow: visible;
    flex: 1;
    color: #fff;
}

.chevron {
    font-size: 10px;
    color: var(--text-gray);
}

/* DROPDOWN */
.user-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: #0f0f15;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 6px;
    z-index: 100;
    transform-origin: bottom center;
    transform: scale(0.95) translateY(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.25, 1, 0.5, 1), transform 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.user-dropdown.active {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: all;
}

.user-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-gray);
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
}

.user-dropdown button:hover {
    background: rgba(139, 92, 246, 0.1);
    color: #fff;
}

.dropdown-sep {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin: 4px 0;
}

.user-dropdown .logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
}

/* MAIN CONTENT */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* HEADER & LIVE BETS TICKER */
.app-header {
    height: 90px;
    background-color: var(--bg-darker);
    border-bottom: none;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 5;
}

.live-bets-container {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    overflow: hidden;
}

.live-bets-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-gray);
    letter-spacing: 1px;
    border-right: 1px solid var(--border-color);
    padding-right: 15px;
    white-space: nowrap;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--green);
    box-shadow: 0 0 8px var(--green);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.6; }
}

.live-bets-feed {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    width: 100%;
    padding-bottom: 5px;
}

.live-bets-feed::-webkit-scrollbar { display: none; }

.bet-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    min-width: 130px;
    animation: betSlide 0.3s ease-out;
}

.bet-card.win {
    border-left: 3px solid var(--green);
}

.bet-card.lose {
    border-left: 3px solid var(--red);
}

@keyframes betSlide {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.bet-card-user {
    font-weight: 700;
}

.bet-card-game {
    color: var(--text-gray);
}

.bet-card-value {
    font-weight: 800;
    color: var(--green);
}

.bet-card.lose .bet-card-value {
    color: var(--text-gray);
}

/* WORKSPACE TAB VIEWS */
.app-workspace {
    padding: 40px;
    flex: 1;
}

.workspace-tab {
    display: flex;
    flex-direction: column;
    gap: 30px;
    animation: tabFade 0.2s ease-out;
}

@keyframes tabFade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tab-header h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 32px;
    font-weight: 800;
}

.tab-desc {
    color: var(--text-gray);
    font-size: 14px;
    margin-top: 4px;
}

/* COINFLIP LOBBY MATCHES */
.match-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.coinflip-match {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 14px 20px;
    border-radius: 12px;
    display: grid;
    grid-template-columns: 170px 1fr 130px 100px 90px;
    align-items: center;
    gap: 15px;
    transition: all 0.2s;
}

.coinflip-match:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.match-vs-avatars {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.avatar-wrapper {
    position: relative;
    width: 44px;
    height: 44px;
}

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    background: #111;
}

.avatar-img.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-dark);
    font-size: 20px;
    border: 2px dashed var(--text-dark);
}

.avatar-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    border: 1px solid var(--bg-card);
}

.avatar-badge.heads {
    background: linear-gradient(135deg, var(--orange), #c2410c);
}

.avatar-badge.tails {
    background: linear-gradient(135deg, var(--blue), #1d4ed8);
}

.match-vs-divider {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-dark);
}

.match-wager-items {
    display: flex;
    align-items: center;
}

.wager-item-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #0f0f15;
    border: 1px solid var(--border-color);
    margin-right: -14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    position: relative;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.wager-item-circle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wager-item-more-badge {
    background: #1c1d26;
    border: 1px solid var(--border-color);
    color: var(--text-white);
    font-size: 11px;
    font-weight: 900;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 20px;
}

.match-value-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.match-value {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-white);
}

.match-value-range {
    font-size: 11px;
    color: var(--text-dark);
    margin-top: 2px;
    font-weight: 700;
}

.match-target-side-chip {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.match-target-side-chip.heads {
    background: linear-gradient(135deg, var(--orange), #c2410c);
    border: 2px solid #fed7aa;
}

.match-target-side-chip.tails {
    background: linear-gradient(135deg, var(--blue), #1d4ed8);
    border: 2px solid #bfdbfe;
}

/* BUTTONS */
.btn {
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--purple);
    color: #050508;
    font-weight: 800;
    border-radius: 12px;
    transition: background 0.15s ease;
}

.btn-primary:hover {
    background: #ff7bb2;
}

.btn-primary:active {
    background: #b8206c;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid var(--border-color);
    color: var(--text-white);
    font-weight: 700;
    border-radius: 12px;
    transition: background 0.15s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-success {
    background: var(--green);
    color: #050508;
    font-weight: 800;
    border-radius: 12px;
    transition: background 0.15s ease;
}

.btn-success:hover {
    background: #34d399;
}

.btn-success:active {
    background: #047857;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

/* ==========================================
   BLACKJACK REDESIGN (Bloxyspin Layout)
   ========================================== */
.bj-game-container {
    display: flex;
    gap: 30px;
    height: 800px;
}

.bj-sidebar-controls {
    width: 320px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}

.bj-action-grid {
    margin-top: auto;
}

.bj-action-row {
    display: flex;
    gap: 10px;
}

.btn-bj-action {
    flex: 1;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
    color: #fff;
    transition: all 0.15s;
}

.btn-bj-action.btn-hit { background-color: var(--purple); box-shadow: 0 0 10px var(--purple-glow); }
.btn-bj-action.btn-stand { background-color: var(--blue); }
.btn-bj-action.btn-double { background-color: var(--orange); }

.btn-bj-action.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.bj-sidebar-value {
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    background: rgba(0,0,0,0.2);
    padding: 10px;
    border-radius: 8px;
}

.bj-table-canvas {
    flex: 1;
    background: rgba(0,0,0,0.15);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 20px 25px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    align-items: center !important;
    position: relative;
    height: 100% !important;
    box-sizing: border-box;
}

.bj-table-slot {
    width: 170px !important;
    border: 1.5px dashed rgba(255,255,255,0.08);
    border-radius: 16px;
    background: rgba(255,255,255,0.015);
    padding: 15px 10px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 15px !important;
    min-height: 340px !important;
    height: 340px !important;
    position: relative;
    box-sizing: border-box;
    flex-shrink: 0 !important; /* Prevent flex shrink squeezing height! */
}

.slot-badge {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--text-gray);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    white-space: nowrap;
    z-index: 2;
}

.slot-score {
    position: absolute;
    bottom: -12px;
    background: var(--purple);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 4px 8px var(--purple-glow);
    z-index: 2;
}

.cards-row-large {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 160px;
    position: relative;
}

.card-placeholder {
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
}

/* LARGER CARDS FOR BLACKJACK */
.cards-row-large .card-container {
    perspective: 1000px;
    width: 115px;
    height: 160px;
    margin: 0 -45px; /* Overlap cards horizontally */
    transition: transform 0.2s;
}

.cards-row-large .card-front, .cards-row-large .card-back {
    font-size: 36px;
    font-weight: 800;
    box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}

/* Specific Baccarat override rules for side-by-side dealing and custom size */
#bacc-player-cards-slot .card-container,
#bacc-banker-cards-slot .card-container {
    width: 75px !important;
    height: 108px !important;
    margin: 0 4px !important;
    perspective: 1000px !important;
}

#bacc-player-cards-slot .card-front,
#bacc-player-cards-slot .card-back,
#bacc-banker-cards-slot .card-front,
#bacc-banker-cards-slot .card-back {
    font-size: 22px !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4) !important;
}

/* Billboard banner */
.bj-billboard-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 24px;
    background: rgba(139, 92, 246, 0.04);
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: 12px;
}

.banner-line {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--purple);
}

/* ==========================================
   BACCARAT CANVAS
   ========================================== */
.bacc-arena {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
}

.bacc-layout {
    width: 100%;
    display: flex;
    gap: 20px;
    align-items: center;
    flex-direction: row;
}

.bacc-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.hand-score {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-gray);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.score-badge {
    background: rgba(255,255,255,0.04);
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 6px;
    color: #fff;
}

.cards-row {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 115px;
    position: relative;
    width: 100%;
}

/* 3D CARD ANIMATIONS & TRANSITIONS */
@keyframes deal-card-slide {
    from {
        opacity: 0;
        transform: translateY(-50px) rotate(-10deg) scale(0.85);
        filter: blur(2px);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotate(0deg) scale(1);
        filter: blur(0);
    }
}

.card-container {
    perspective: 1000px;
    width: 80px;
    height: 115px;
    margin: 0 -30px; /* Overlap cards horizontally */
    transition: transform 0.2s;
    animation: deal-card-slide 0.45s cubic-bezier(0.18, 0.89, 0.32, 1.28) both;
}

/* Button micro-interactions */
.btn, .btn-bj-action, .cf-side-option {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn:hover, .btn-bj-action:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}
.btn:active, .btn-bj-action:active:not(.disabled) {
    transform: translateY(0);
}

/* Custom premium scrollbar for lists */
.inventory-grid::-webkit-scrollbar,
#bet-inventory-list::-webkit-scrollbar,
.settings-content::-webkit-scrollbar {
    width: 6px;
}
.inventory-grid::-webkit-scrollbar-track,
#bet-inventory-list::-webkit-scrollbar-track,
.settings-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
    border-radius: 8px;
}
.inventory-grid::-webkit-scrollbar-thumb,
#bet-inventory-list::-webkit-scrollbar-thumb,
.settings-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.02);
}
.inventory-grid::-webkit-scrollbar-thumb:hover,
#bet-inventory-list::-webkit-scrollbar-thumb:hover,
.settings-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

.card-inner {
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    position: relative;
}

.card-container.reveal .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.card-front {
    background: #fff;
    color: #111;
    transform: rotateY(180deg);
}

.card-front.red {
    color: var(--red);
}

.card-back {
    background: linear-gradient(135deg, #4c1d95, #1e1b4b);
    border: 2px solid var(--purple);
    color: transparent;
}

.divide-line {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-dark);
}

.bacc-board-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* BACCARAT CHIPS */
.bacc-bet-selector {
    display: flex;
    gap: 15px;
}

.bacc-chip {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    color: var(--text-white);
    padding: 16px 28px;
    border-radius: 12px;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.bacc-chip:hover {
    border-color: var(--purple);
}

.bacc-chip.selected {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--purple);
    box-shadow: 0 0 15px var(--purple-glow);
}

.payout-mult {
    font-size: 11px;
    color: var(--text-gray);
    margin-top: 4px;
}

/* MINES GAME ARENA */
.mines-arena {
    display: flex;
    gap: 40px;
}

.mines-sidebar-controls {
    width: 260px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
}

.mines-mult-panel {
    display: flex;
    gap: 10px;
}

.mult-card {
    flex: 1;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}

.mult-card p {
    font-size: 11px;
    color: var(--text-gray);
}

.mult-card h2 {
    font-size: 18px;
    margin-top: 4px;
    font-weight: 800;
}

.mines-board-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mines-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    width: 530px;
    height: 530px;
}

.mines-grid.disabled {
    pointer-events: none;
}

/* 3D MINES TILE FLIPS */
.mine-tile {
    perspective: 1000px;
    position: relative;
    width: 98px;
    height: 98px;
    border-radius: 12px;
}

.tile-inner {
    width: 100%;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.2);
    transform-style: preserve-3d;
    position: relative;
}

.mine-tile.revealed .tile-inner {
    transform: rotateY(180deg);
}

.tile-front, .tile-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

.tile-front {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    transition: background 0.1s;
}

.tile-front:hover {
    background: rgba(139, 92, 246, 0.08);
    border-color: var(--border-hover);
}

.tile-back {
    transform: rotateY(180deg);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.tile-back.gem {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--green);
}

.tile-back.mine {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--red);
}

/* ==========================================
   CHAT AREA (Bloxyspin Styled)
   ========================================== */
.app-chat {
    width: 280px;
    background-color: var(--bg-darker);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.chat-header {
    height: 90px;
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.chat-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-gray);
    letter-spacing: 1px;
}

.chat-online-badge {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: var(--green);
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: none; /* Firefox */
}

.chat-messages::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.chat-msg {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: msgFade 0.25s ease-out forwards;
}

@keyframes msgFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple), #4c1d95);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.15);
    flex-shrink: 0;
}

.msg-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.msg-user-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.msg-user {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-white);
}

.msg-lvl {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 9px;
    font-weight: 800;
    color: var(--text-gray);
    padding: 1px 5px;
    border-radius: 4px;
}

.msg-bubble {
    background: rgba(255,255,255,0.015);
    border: 1px solid rgba(255,255,255,0.03);
    padding: 8px 12px;
    border-radius: 0 12px 12px 12px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-white);
    max-width: 100%;
    word-break: break-word;
}

.chat-input-area {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.chat-input-area input {
    width: 100%;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px;
    color: #fff;
    outline: none;
    font-size: 13px;
}

.chat-input-area input:focus {
    border-color: var(--purple);
}

/* MODALS */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(9, 10, 15, 0.85);
    z-index: 500;
    transition: opacity 0.25s ease-in-out;
    opacity: 0;
    pointer-events: none;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -42%) scale(0.94);
    width: 460px;
    max-width: 90%;
    background: #0f0f15;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    z-index: 600;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
    opacity: 0;
    pointer-events: none;
}

.modal.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.modal h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 22px;
    font-weight: 700;
}

.modal-desc {
    color: var(--text-gray);
    font-size: 13px;
    margin-top: 6px;
    margin-bottom: 25px;
}

/* 3D COINFLIP ROLL WIDGET */
.coinflip-spinner-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 30px;
}

.coin-visual {
    width: 120px;
    height: 120px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 3s cubic-bezier(0.1, 0.8, 0.15, 1);
}

.coin-visual.spinning {
    animation: spinInfinite 1s linear infinite !important;
}

@keyframes spinInfinite {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

.coin-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(0,0,0,0.6);
}

.coin-front {
    background: linear-gradient(135deg, var(--orange), #c2410c);
    border: 4px solid #fed7aa;
    color: #fff;
}

.coin-back {
    background: linear-gradient(135deg, var(--blue), #1d4ed8);
    border: 4px solid #bfdbfe;
    color: #fff;
    transform: rotateY(180deg);
}

/* GEMS INPUT AND PET SECTIONS */
.gems-wager-section {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 15px;
}

.wager-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-gray);
    letter-spacing: 1px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 8px;
}

.gems-wager-row {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 8px;
}

.wager-input {
    flex: 2 !important;
    text-align: left !important;
    font-weight: 700;
    font-size: 15px !important;
    color: var(--green) !important;
}

.max-gems-label {
    font-size: 11px;
    color: var(--text-dark);
    margin-top: 6px;
    text-align: right;
}

/* INVENTORIES */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-height: 260px;
    overflow-y: auto;
}

.inventory-item {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.inventory-item:hover {
    border-color: var(--border-hover);
}

.inventory-item.selected {
    background: rgba(139, 92, 246, 0.12);
    border-color: var(--purple);
    box-shadow: 0 0 10px var(--purple-glow);
}

.inventory-item.selected::after {
    content: "✓";
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--purple);
    color: #fff;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.item-name {
    font-size: 11px;
    font-weight: 700;
    margin-top: 6px;
}

.item-amount {
    font-size: 11px;
    color: var(--text-gray);
    margin-top: 2px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-gray);
}

.form-control {
    background: rgba(255,255,255,0.015);
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 11px 13px;
    color: #fff;
    outline: none;
    font-size: 14px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-control:focus {
    border-color: var(--purple);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
}

.code-box {
    background: rgba(139, 92, 246, 0.08);
    border: 1px dashed var(--purple);
    color: var(--purple);
    font-size: 24px;
    font-weight: 800;
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    letter-spacing: 2px;
}

/* NOTIFICATIONS */
.notification-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10000;
    align-items: center;
}

.notification {
    background: #0f0f15;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--purple);
    padding: 12px 20px;
    border-radius: 8px;
    min-width: 260px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.notification.success { border-left-color: var(--green); }
.notification.error { border-left-color: var(--red); }

.notification-close {
    background: none;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    margin-left: 10px;
}

@keyframes slideIn {
    from { transform: translateY(-30px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.hidden { display: none !important; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.w-100 { width: 100%; }
.gems-green { color: var(--green); }

/* Mines grid shaking */
.mines-grid.shake {
    animation: gridShake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes gridShake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Page Transition Wipe overlay styling */
#transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #07080b;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1), transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 1;
    pointer-events: none;
}

#transition-overlay.hidden {
    opacity: 0;
    transform: scale(1.05);
}

.fade-in-slide-up {
    animation: fadeInUp 0.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* PREMIUM INTERACTIVE WORKSPACE ANIMATIONS */
.workspace-tab:not(.hidden) {
    animation: tabFadeIn 0.35s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(12px) scale(0.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.game-card {
    width: 100%;
    height: 145px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    box-shadow: 0 6px 15px rgba(0,0,0,0.4);
    box-sizing: border-box;
}

.game-card:hover {
    border-color: rgba(255, 74, 151, 0.4) !important;
    box-shadow: 0 4px 15px rgba(255, 74, 151, 0.15) !important;
}

.chat-msg {
    animation: chatSlideIn 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    transition: transform 0.2s ease;
}

.chat-msg:hover {
    transform: translateX(4px);
}

@keyframes chatSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#live-bets-table-rows tr {
    animation: betRowIn 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes betRowIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Button pulse scale hover transitions */
.btn {
    transition: transform 0.08s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.08s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.15s ease;
}

.btn:hover {
    filter: brightness(1.1);
}

.btn:active {
    filter: brightness(0.9);
}

/* COLLAPSED SIDEBAR RULES */
.app-sidebar.collapsed .sidebar-balance,
.app-sidebar.collapsed .sidebar-section-title,
.app-sidebar.collapsed .nav-text,
.app-sidebar.collapsed .sidebar-footer {
    display: none !important;
}

.app-sidebar.collapsed .sidebar-scrollable-content {
    padding: 15px 8px !important;
    gap: 12px !important;
}

.app-sidebar.collapsed .nav-item {
    justify-content: center !important;
    padding: 12px 0 !important;
    transform: none !important;
    gap: 0 !important;
}

.app-sidebar.collapsed .sidebar-logo-container {
    padding: 0 8px !important;
}

.app-sidebar.collapsed .logo-text {
    display: none !important;
}

.app-sidebar.collapsed .logo-text-collapsed {
    display: block !important;
}

.app-sidebar.collapsed .sidebar-menu-toggle {
    margin: 0 auto !important;
    padding: 12px !important;
    justify-content: center !important;
    width: fit-content;
}

.app-sidebar.collapsed .sidebar-menu-toggle .menu-text {
    display: none !important;
}

/* COLLAPSIBLE NAV LISTS */
.sidebar-nav-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    max-height: 320px;
    opacity: 1;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

.sidebar-nav-list::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav-list::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

.sidebar-nav-list.collapsed {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

/* SIDEBAR SECTION GROUP CARDS */
.sidebar-section {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    padding: 14px;
    margin: 0 15px 15px 15px;
    display: flex;
    flex-direction: column;
    transition: all 0.25s ease;
}

.app-sidebar.collapsed .sidebar-section {
    background: transparent !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 8px !important;
}

.sidebar-section-title {
    font-size: 10px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 0 8px;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.sidebar-section-title:hover {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Hide number input spinners (up/down arrows) */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* SIDEBAR CONTROLS HEADER */
.sidebar-controls-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
    margin-bottom: 16px;
    width: 100%;
}

.sidebar-controls-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.sidebar-controls-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-controls-title::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 18px;
    background: #2563eb;
    border-radius: 2px;
}

.sidebar-controls-desc {
    font-size: 11px;
    color: var(--text-gray);
    margin: 6px 0 0 0;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
}

.fav-star-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 26px;
    height: 26px;
}

.fav-star-btn:hover {
    color: #eab308;
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

/* CUSTOM DROPDOWN OPTIONS OVERRIDES */
select, select.form-control, select.form-control option, option {
    background-color: #0f1016 !important;
    color: #fff !important;
    border-radius: 8px;
}

#bet-modal {
    width: 580px !important;
}

@keyframes slow-shuffle {
    0% { transform: translateX(0) translateY(0) rotate(0deg); }
    20% { transform: translateX(6px) translateY(-2px) rotate(8deg); }
    40% { transform: translateX(-6px) translateY(1px) rotate(-8deg); }
    60% { transform: translateX(4px) translateY(-1px) rotate(4deg); }
    80% { transform: translateX(-4px) translateY(2px) rotate(-4deg); }
    100% { transform: translateX(0) translateY(0) rotate(0deg); }
}

.shuffling-active {
    animation: slow-shuffle 1.5s ease-in-out infinite !important;
}

/* Global Custom Scrollbars to replace default white scroll wheels */
::-webkit-scrollbar {
    width: 6px !important;
    height: 6px !important;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3) !important;
    border-radius: 10px !important;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12) !important;
    border-radius: 10px !important;
    border: 1px solid rgba(0, 0, 0, 0.2) !important;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25) !important;
}

::-webkit-scrollbar-corner {
    background: transparent !important;
}

/* Firefox compatibility scrollbar styling */
* {
    scrollbar-width: thin !important;
    scrollbar-color: rgba(255, 255, 255, 0.12) rgba(0, 0, 0, 0.3) !important;
}

/* Custom interactive toggle switch */
.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.08) !important;
    border: 1px solid var(--border-color);
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px !important;
}

.switch .slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-gray);
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
}

.switch input:checked + .slider {
    background-color: #3b82f6 !important; /* Default fallback */
}
/* Live Bets Switch specific */
#live-bets-toggle:checked + .slider {
    background-color: #00e7df !important;
    border-color: #00e7df;
}

.switch input:checked + .slider:before {
    transform: translateX(16px);
    background-color: #fff;
}

/* Gold Theme */
body.theme-gold {
    --bg-main: #14110b;
    --bg-darker: #0c0a06;
    --bg-card: #1e1b12;
    --purple: #ffb703;
    --purple-glow: rgba(255, 183, 3, 0.4);
    --border-hover: rgba(255, 183, 3, 0.3);
    --purple-shadow: #b78a02;
}

/* Green Theme */
body.theme-green {
    --bg-main: #060e0a;
    --bg-darker: #030806;
    --bg-card: #0d1e16;
    --purple: #00e676;
    --purple-glow: rgba(0, 230, 118, 0.4);
    --border-hover: rgba(0, 230, 118, 0.3);
    --purple-shadow: #00a353;
}

/* Purple Theme */
body.theme-purple {
    --bg-main: #0c0817;
    --bg-darker: #06040c;
    --bg-card: #171128;
    --purple: #bf5af2;
    --purple-glow: rgba(191, 90, 242, 0.4);
    --border-hover: rgba(191, 90, 242, 0.3);
    --purple-shadow: #883dc7;
}

/* Chat Reply Feature Styles */
.chat-msg {
    position: relative;
}

.msg-reply-btn {
    opacity: 0;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-gray);
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    transition: opacity 0.2s, color 0.2s;
    margin-left: 8px;
    vertical-align: middle;
    padding: 0;
}

.chat-msg:hover .msg-reply-btn {
    opacity: 1;
}

.msg-reply-btn:hover {
    color: var(--purple) !important;
}

.msg-reply-quote {
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid var(--purple);
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 4px;
    margin-bottom: 6px;
    font-size: 12px;
    text-align: left;
}

/* ==========================================
   MOBILE RESPONSIVENESS OVERRIDES
   ========================================== */
#mobile-chat-toggle-btn {
    display: none;
}

@media (max-width: 992px) {
    #mobile-chat-toggle-btn {
        display: flex !important;
    }
    
    /* Absolute overlay chat room for small screens */
    .app-chat {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        height: 100% !important;
        width: 80% !important;
        max-width: 320px !important;
        z-index: 10000 !important;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-left: 2px solid var(--purple) !important;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.6);
    }
    
    .app-chat.mobile-open {
        transform: translateX(0);
    }
    
    .mobile-chat-close-btn {
        display: inline-block !important;
    }
    
    /* Layout adjustments */
    .app-main {
        flex: 1;
        width: 100%;
        max-width: 100vw;
        height: 100vh !important;
        overflow: hidden !important;
    }
    
    .app-workspace {
        height: calc(100vh - 90px - 52px) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 15px !important;
        box-sizing: border-box !important;
    }
    
    /* Hide desktop center stats in header on small devices */
    #header-guest-stats {
        display: none !important;
    }
    
    /* Coinflip row wrapping - Compact grid for mobile */
    .coinflip-match {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: auto auto auto !important;
        gap: 12px !important;
        padding: 16px !important;
        text-align: left !important;
        align-items: center !important;
    }
    
    .match-vs-avatars {
        grid-column: 1 / 2;
        justify-content: flex-start !important;
        margin: 0 !important;
    }
    
    .match-wager-items {
        grid-column: 1 / 3;
        grid-row: 2;
        justify-content: flex-start !important;
        margin: 4px 0 !important;
    }
    
    .match-value-block {
        grid-column: 2 / 3;
        grid-row: 1;
        text-align: right !important;
        justify-content: flex-end !important;
        align-items: flex-end !important;
    }
    
    /* Hide extra side chip column to prevent mobile clutter */
    .coinflip-match > div:nth-child(4) {
        display: none !important;
    }
    
    .coinflip-match > div:nth-child(5) {
        grid-column: 1 / 3;
        grid-row: 3;
        width: 100% !important;
    }
    
    /* Compact chat input space on mobile */
    .chat-input-area {
        padding: 12px !important;
    }
    
    .chat-input-area input {
        padding: 10px 12px !important;
        font-size: 14px !important;
    }
    
    /* Game panels side-by-side flex wrap */
    .bj-game-container {
        flex-direction: column !important;
        height: auto !important;
        gap: 20px !important;
    }
    
    .bj-sidebar-controls {
        width: 100% !important;
    }
    
    .bj-table-canvas {
        min-height: 380px !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important; /* Smooth scroll Baccarat table */
        -webkit-overflow-scrolling: touch !important;
        padding: 20px 10px !important;
    }
    
    /* Ensure Baccarat layout & chips do not get squished and are horizontally slideable */
    .bacc-betting-grid, #bacc-chips-row {
        min-width: 620px !important;
    }
    
    .bacc-roadmap-panel {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        display: flex !important;
        flex-direction: row !important;
    }
    
    .bacc-bead-plate-container {
        min-width: 320px !important;
        flex-shrink: 0 !important;
    }
    
    .bacc-big-road-container {
        min-width: 260px !important;
        flex-shrink: 0 !important;
        margin-left: 10px !important;
    }
    
    .bacc-roadmap-stats {
        flex-shrink: 0 !important;
    }
    
    /* Plinko canvas scaling */
    .plinko-board-wrapper {
        min-height: 360px !important;
        padding: 10px !important;
    }
    
    /* Sidebar mobile adjustment */
    .app-sidebar {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 10001;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .app-sidebar.mobile-open {
        transform: translateX(0);
    }
}

/* Mines Multiplier Popup Animation */
.mines-multiplier-popup {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: 900;
    font-family: 'Space Grotesk', sans-serif;
    color: #10b981;
    text-shadow: 0 0 10px rgba(16,185,129,0.8), 0 2px 4px rgba(0,0,0,0.8);
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    animation: floatUpFade 1s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes floatUpFade {
    0% { opacity: 0; transform: translate(-50%, 0) scale(0.5); }
    20% { opacity: 1; transform: translate(-50%, -15px) scale(1.2); }
    100% { opacity: 0; transform: translate(-50%, -40px) scale(1); }
}

/* Mines Win Overlay Celebration */
.mines-win-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(16,185,129,0.3) 0%, transparent 70%);
    z-index: 20;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: winFlash 2.5s ease forwards;
}

.mines-win-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 42px;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    text-shadow: 0 0 20px #10b981, 0 5px 15px rgba(0,0,0,0.8);
    transform: scale(0.5);
    opacity: 0;
    animation: winTextPop 2.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.mines-win-subtext {
    font-size: 20px;
    font-weight: 800;
    color: #34d399;
    margin-top: 10px;
    opacity: 0;
    animation: winSubTextFade 2.5s ease forwards;
    animation-delay: 0.2s;
}

@keyframes winFlash {
    0% { opacity: 0; background: radial-gradient(circle at center, rgba(255,255,255,0.8) 0%, transparent 70%); }
    15% { opacity: 1; background: radial-gradient(circle at center, rgba(16,185,129,0.4) 0%, transparent 70%); }
    100% { opacity: 0; }
}

@keyframes winTextPop {
    0% { opacity: 0; transform: scale(0.5) translateY(20px); }
    15% { opacity: 1; transform: scale(1.1) translateY(0); }
    30% { transform: scale(1); }
    80% { opacity: 1; transform: scale(1) translateY(0); }
    100% { opacity: 0; transform: scale(0.9) translateY(-20px); }
}

@keyframes winSubTextFade {
    0% { opacity: 0; transform: translateY(10px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; }
}

/* Baccarat & Blackjack unified chip styles */
.baccarat-chips {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.chip {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 3px dashed rgba(255,255,255,0.4);
    box-shadow: 0 4px 8px rgba(0,0,0,0.4), inset 0 0 10px rgba(0,0,0,0.5);
    background: #334155;
    position: relative;
}

.chip::after {
    content: '';
    position: absolute;
    width: calc(100% - 10px);
    height: calc(100% - 10px);
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
}

.chip:hover {
    transform: translateY(-5px) scale(1.05);
}

.chip.selected {
    transform: translateY(-10px) scale(1.15);
    border: 3px solid #fbbf24;
    box-shadow: 0 10px 20px rgba(251,191,36,0.5), inset 0 0 15px rgba(251,191,36,0.3);
    z-index: 10;
}

.chip[data-value="100000000"] {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}
.chip[data-value="250000000"] {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
}
.chip[data-value="500000000"] {
    background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%);
}
.chip[data-value="750000000"] {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}
.chip[data-value="1000000000"] {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Dealer Card Throwing Animation */
@keyframes throwCard {
    0% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
    40% { transform: translate(15px, 20px) rotate(180deg) scale(1.3); opacity: 0.9; }
    80% { transform: translate(30px, 40px) rotate(360deg) scale(0.6); opacity: 0; }
    100% { transform: translate(30px, 40px) rotate(360deg) scale(0.6); opacity: 0; }
}

.dealer-card-throw {
    animation: throwCard 2s infinite cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
}

/* Realistic 3D Casino Action Buttons */
.casino-action-btn {
    border-radius: 50%;
    color: #fff;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    letter-spacing: 1px;
}

.casino-action-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 40%, rgba(0,0,0,0.2) 100%);
    z-index: 1;
    pointer-events: none;
}

.casino-action-btn span {
    position: relative;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.casino-action-btn:active:not(.disabled):not(:disabled) {
    transform: translateY(4px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.8), inset 0 4px 8px rgba(0,0,0,0.6) !important;
}

.casino-action-btn.disabled, .casino-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: translateY(0);
}

.btn-clear-3d {
    width: 65px; height: 65px; font-size: 12px;
    background: #334155;
    border: 1px solid #1e293b;
    box-shadow: 0 6px 0 #1e293b, 0 8px 15px rgba(0,0,0,0.5), inset 0 2px 4px rgba(255,255,255,0.2);
}

.btn-hit-3d {
    width: 70px; height: 70px; font-size: 14px;
    background: #2563eb;
    border: 1px solid #1d4ed8;
    box-shadow: 0 6px 0 #1e3a8a, 0 8px 15px rgba(37,99,235,0.4), inset 0 2px 4px rgba(255,255,255,0.3);
}

.btn-deal-3d {
    width: 90px; height: 90px; font-size: 18px;
    background: #10b981;
    border: 1px solid #059669;
    box-shadow: 0 8px 0 #065f46, 0 10px 25px rgba(16,185,129,0.5), inset 0 2px 5px rgba(255,255,255,0.4);
}
.btn-deal-3d:active:not(.disabled):not(:disabled) {
    transform: translateY(6px);
    box-shadow: 0 2px 0 #065f46, 0 4px 10px rgba(16,185,129,0.5), inset 0 4px 8px rgba(0,0,0,0.6) !important;
}

.btn-stand-3d {
    width: 70px; height: 70px; font-size: 14px;
    background: #ef4444;
    border: 1px solid #dc2626;
    box-shadow: 0 6px 0 #991b1b, 0 8px 15px rgba(239,68,68,0.4), inset 0 2px 4px rgba(255,255,255,0.3);
}

.btn-double-3d {
    width: 65px; height: 65px; font-size: 11px;
    background: #f59e0b;
    border: 1px solid #d97706;
    box-shadow: 0 6px 0 #92400e, 0 8px 15px rgba(245,158,11,0.4), inset 0 2px 4px rgba(255,255,255,0.3);
}

/* Baccarat Winner Banner & Glow */
@keyframes winnerGlow {
    0% { box-shadow: 0 0 10px rgba(255,215,0,0.5), inset 0 0 10px rgba(255,215,0,0.2); border-color: rgba(255,215,0,0.8); }
    50% { box-shadow: 0 0 30px rgba(255,215,0,1), inset 0 0 30px rgba(255,215,0,0.6); border-color: rgba(255,215,0,1); background: rgba(255,215,0,0.2); }
    100% { box-shadow: 0 0 10px rgba(255,215,0,0.5), inset 0 0 10px rgba(255,215,0,0.2); border-color: rgba(255,215,0,0.8); }
}
.bacc-zone-winner {
    animation: winnerGlow 1.5s infinite;
    z-index: 5;
}
.bacc-zone-winner-text {
    text-shadow: 0 0 10px #fff;
    color: #ffd700 !important;
}

#bacc-winner-banner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 50;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
#bacc-winner-banner.hidden {
    opacity: 0;
    transform: translate(-50%, -40%);
}
#bacc-winner-banner:not(.hidden) {
    opacity: 1;
    transform: translate(-50%, -50%);
    animation: popInBanner 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popInBanner {
    0% { opacity: 0; transform: translate(-50%, -30%) scale(0.5); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.banner-title {
    font-size: 36px;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    text-shadow: 0 4px 10px rgba(0,0,0,0.8), 0 0 20px rgba(255,255,255,0.4);
    letter-spacing: 2px;
    margin-bottom: 2px;
}
.banner-you-win {
    font-size: 20px;
    font-weight: 900;
    color: #4ade80;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8), 0 0 15px rgba(74, 222, 128, 0.6);
    letter-spacing: 3px;
    margin-bottom: 5px;
    animation: pulse 1s infinite alternate;
}
.banner-you-win.hidden {
    display: none;
}
.banner-win-amount {
    font-size: 28px;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 4px 10px rgba(0,0,0,0.8), 0 0 20px rgba(255,215,0,0.6);
}

/* COINFLIP LOBBY REDESIGN */
.coinflip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.coinflip-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
}
.coinflip-card:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: rgba(168, 85, 247, 0.3);
    box-shadow: 0 12px 30px rgba(168, 85, 247, 0.15);
    background: rgba(255, 255, 255, 0.03);
}
.coinflip-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.cf-avatar-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    width: 60px;
}
.cf-avatar-block img {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.1);
    background: #0f1016;
}
.cf-avatar-empty {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    border: 2px dashed rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-gray);
    font-size: 20px;
    background: rgba(255,255,255,0.01);
}
.cf-badge {
    position: absolute;
    bottom: -6px;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 6px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.cf-badge.heads { background: #eab308; box-shadow: 0 2px 8px rgba(234, 179, 8, 0.4); }
.cf-badge.tails { background: #3b82f6; box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4); }
.cf-vs-badge {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 900;
    color: var(--text-gray);
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cf-card-wager {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}
.cf-card-value {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}
.cf-card-val-main {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
}
.cf-card-val-sub {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-gray);
}
.cf-btn-join {
    width: 100%;
    background: linear-gradient(90deg, var(--purple) 0%, #d946ef 100%);
    color: #fff;
    font-weight: 800;
    padding: 12px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
    transition: all 0.2s ease;
}
.cf-btn-join:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.6);
}
.cf-btn-view {
    width: 100%;
    background: rgba(255,255,255,0.05);
    color: #fff;
    font-weight: 700;
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.2s ease;
}
.cf-btn-view:hover {
    background: rgba(255,255,255,0.1);
}

.bucket-flash {
    animation: bucketFlash 0.35s ease-out forwards;
}
@keyframes bucketFlash {
    0% { transform: scale(1.15) translateY(-4px); box-shadow: 0 0 20px rgba(139, 92, 246, 0.8); }
    100% { transform: scale(1) translateY(0); box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
}

