@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@700&family=Orbitron:wght@900&family=Mr+Dafoe&display=swap');
        
        * { margin: 0; padding: 0; box-sizing: border-box; text-transform: uppercase; }

        body {
            background: #010105;
            font-family: 'Fira Code', monospace;
            color: #f0f;
            min-height: 100vh;
            min-height: 100dvh;
            padding-top: env(safe-area-inset-top, 0px);
            padding-bottom: env(safe-area-inset-bottom, 0px);
            overflow-y: auto;
            display: flex;
            align-items: flex-start; /* Changed from center to allow scrolling up */
            justify-content: center;
            overscroll-behavior-y: none;
            -webkit-overflow-scrolling: touch;
        }
        
        /* === SCENERY & BACKGROUND === */
        .scenery {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -1;
            background: radial-gradient(circle at 50% 60%, rgba(80, 0, 200, 0.15) 0%, transparent 60%);
        }
        
        /* Synthwave Sun */
        .synthwave-sun {
            position: absolute;
            bottom: 25%;
            left: 50%;
            transform: translateX(-50%);
            width: 280px;
            height: 280px;
            border-radius: 50%;
            background: linear-gradient(180deg, #ff0090 0%, #ff6b35 30%, #ffea00 60%, #ff0090 100%);
            box-shadow: 0 0 60px rgba(255, 0, 144, 0.5), 0 0 120px rgba(255, 107, 53, 0.3);
            overflow: hidden;
            opacity: 0.7;
        }
        .synthwave-sun::before {
            content: '';
            position: absolute;
            left: 0;
            width: 100%;
            background: #010105;
        }
        .synthwave-sun::before { top: 35%; height: 8%; }
        .synthwave-sun::after {
            content: '';
            position: absolute;
            left: 0;
            width: 100%;
            background: #010105;
        }
        .synthwave-sun::after { top: 48%; height: 6%; }
        .sun-stripe-1 {
            position: absolute;
            left: 0;
            top: 60%;
            width: 100%;
            height: 5%;
            background: #010105;
        }
        .sun-stripe-2 {
            position: absolute;
            left: 0;
            top: 70%;
            width: 100%;
            height: 8%;
            background: #010105;
        }
        .sun-stripe-3 {
            position: absolute;
            left: 0;
            top: 82%;
            width: 100%;
            height: 12%;
            background: #010105;
        }
        
        /* Starfield */
        .stars {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-image:
                radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.8), transparent),
                radial-gradient(1px 1px at 30% 60%, rgba(255,255,255,0.6), transparent),
                radial-gradient(2px 2px at 50% 10%, rgba(255,255,255,0.9), transparent),
                radial-gradient(1px 1px at 70% 40%, rgba(255,255,255,0.7), transparent),
                radial-gradient(1px 1px at 90% 80%, rgba(255,255,255,0.5), transparent),
                radial-gradient(2px 2px at 15% 85%, rgba(255,255,255,0.8), transparent),
                radial-gradient(1px 1px at 85% 15%, rgba(255,255,255,0.6), transparent),
                radial-gradient(1px 1px at 45% 45%, rgba(255,255,255,0.7), transparent),
                radial-gradient(2px 2px at 25% 35%, rgba(255,255,255,0.9), transparent),
                radial-gradient(1px 1px at 65% 75%, rgba(255,255,255,0.5), transparent);
            /* OPTIMIZATION: Disable twinkle animation for better performance */
            opacity: 0.8;
        }
        
        .grid-bg {
            position: absolute;
            width: 400%;
            height: 400%;
            bottom: -100%;
            left: -150%;
            background-image:
                linear-gradient(rgba(255, 0, 255, 0.15) 1px, transparent 1px),
                linear-gradient(90deg, rgba(0, 255, 255, 0.12) 1px, transparent 1px);
            background-size: 50px 50px;
            transform: perspective(500px) rotateX(65deg);
        }
        /* OPTIMIZATION: Disable grid animation for better performance */
        /* .grid-anim { animation: gridMove 15s linear infinite; } */

        /* === CRT EFFECTS === */
        .crt-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 10000;
        }
        .vignette {
            background: radial-gradient(
                ellipse at center,
                transparent 50%,
                rgba(0, 0, 0, 0.35) 100%
            );
        }
        
        /* === GAME CONTAINER === */
        .game-container {
            background: rgba(10, 10, 25, 0.95);
            border: 2px solid #ff00ff;
            box-shadow:
                0 0 30px rgba(255, 0, 255, 0.3),
                0 0 60px rgba(255, 0, 255, 0.15),
                inset 0 0 30px rgba(0, 0, 0, 0.5);
            padding: 8px 6px 6px;
            margin-top: 16px;
            border-radius: 12px;
            width: 96%;
            max-width: 380px;
            z-index: 5;
            backdrop-filter: blur(15px);
            display: flex;
            flex-direction: column;
            position: relative;
            overflow: hidden;
            -webkit-user-select: none;
            user-select: none;
            -webkit-touch-callout: none;
        }
        
        /* === GLITCH EFFECT === */
        @keyframes glitch {
            0% { transform: translate(0); }
            20% { transform: translate(-3px, 2px); }
            40% { transform: translate(3px, -2px); }
            60% { transform: translate(-2px, -1px); }
            80% { transform: translate(2px, 1px); }
            100% { transform: translate(0); }
        }
        @keyframes glitchClip {
            0% { clip-path: inset(0 0 100% 0); }
            20% { clip-path: inset(20% 0 60% 0); }
            40% { clip-path: inset(50% 0 30% 0); }
            60% { clip-path: inset(70% 0 10% 0); }
            80% { clip-path: inset(10% 0 80% 0); }
            100% { clip-path: inset(0 0 0 0); }
        }
        .multiplier-display.glitch {
            animation: glitch 0.3s ease-in-out;
            position: relative;
        }
        .multiplier-display.glitch::after {
            content: attr(data-text);
            position: absolute;
            left: 2px;
            top: 0;
            color: #00ffff;
            text-shadow: -2px 0 #ff0000;
            animation: glitchClip 0.3s ease-in-out;
            z-index: -1;
        }
        
        /* Screen Shake Animation */
        .game-container.shake {
            animation: screenShake 0.3s ease-out;
        }
        @keyframes screenShake {
            0%, 100% { transform: translate(0, 0); }
            10% { transform: translate(-4px, -2px); }
            20% { transform: translate(4px, 2px); }
            30% { transform: translate(-3px, 1px); }
            40% { transform: translate(3px, -1px); }
            50% { transform: translate(-2px, 2px); }
            60% { transform: translate(2px, -2px); }
            70% { transform: translate(-1px, 1px); }
            80% { transform: translate(1px, -1px); }
            90% { transform: translate(-1px, 0px); }
        }
        
        /* === LOGO & TITLE === */
        .logo-wrap { position: relative; height: 45px; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; margin-bottom: 4px; flex-shrink: 0; }
        
        /* Chrome/Metallic Gradient Title */
        .logo-text {
            font-family: 'Orbitron', sans-serif;
            font-size: 1.2rem;
            font-weight: 900;
            background: linear-gradient(
                180deg,
                #ffffff 0%,
                #e0e0e0 15%,
                #ffffff 25%,
                #a0a0a0 35%,
                #ffffff 45%,
                #c0c0c0 55%,
                #ffffff 65%,
                #808080 75%,
                #ffffff 85%,
                #d0d0d0 100%
            );
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
            transform: skewX(-12deg);
            letter-spacing: 2px;
        }
        
        .logo-80s {
            font-family: 'Mr Dafoe', cursive;
            color: #ff0090;
            font-size: 1.2rem;
            position: absolute;
            bottom: -4px;
            right: 15%;
            transform: rotate(-12deg);
            text-transform: none;
            text-shadow:
                0 0 5px #ff0090,
                0 0 10px #ff0090,
                0 0 20px #ff0090,
                0 0 40px #ff0066;
            /* OPTIMIZATION: Disable neonPulse animation for better performance */
            /* animation: neonPulse 2s ease-in-out infinite; */
        }

        .history-bar { display: flex; gap: 6px; margin-bottom: 8px; overflow-x: auto; padding: 4px 2px; scrollbar-width: none; border-bottom: 1px solid rgba(255, 0, 255, 0.3); min-height: 30px; align-items: center; flex-shrink: 0; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
        .history-bar::-webkit-scrollbar { display: none; }
        .hist-item {
            padding: 2px 6px;
            border-radius: 3px;
            font-size: 0.6rem;
            font-weight: 900;
            border: 1px solid;
            background: rgba(0,0,0,0.4);
            flex-shrink: 0;
            text-shadow: 0 0 5px currentColor;
        }
        /* Color blindness-friendly history indicators with shape differentiation */
        .m-low {
            color: #ff0055;
            border-color: #ff0055;
            box-shadow: 0 0 5px rgba(255, 0, 85, 0.3);
            display: inline-flex !important;
            align-items: center;
            gap: 5px;
            padding: 3px 8px 3px 6px !important;
        }
        .m-low::before {
            content: '▼';
            font-size: 0.4rem;
            flex-shrink: 0;
            line-height: 1;
            margin-right: 2px;
        }
        .m-mid {
            color: #00ffff;
            border-color: #00ffff;
            box-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
            display: inline-flex !important;
            align-items: center;
            gap: 5px;
            padding: 3px 8px 3px 6px !important;
        }
        .m-mid::before {
            content: '●';
            font-size: 0.4rem;
            flex-shrink: 0;
            line-height: 1;
            margin-right: 2px;
        }
        .m-high {
            color: #cc00ff;
            border-color: #cc00ff;
            box-shadow: 0 0 5px rgba(204, 0, 255, 0.3);
            display: inline-flex !important;
            align-items: center;
            gap: 5px;
            padding: 3px 8px 3px 6px !important;
        }
        .m-high::before {
            content: '★';
            font-size: 0.45rem;
            flex-shrink: 0;
            line-height: 1;
            margin-right: 2px;
        }
        .m-moon {
            color: #ffea00;
            border: 1px solid rgba(255, 234, 0, 0.6);
            box-shadow: 0 0 4px rgba(255, 234, 0, 0.3);
            display: inline-flex !important;
            align-items: center;
            gap: 5px;
            padding: 3px 8px 3px 6px !important;
        }
        .m-moon::before {
            content: '♛';
            font-size: 0.45rem;
            flex-shrink: 0;
            line-height: 1;
            margin-right: 2px;
        }

        .chart-wrapper {
            position: relative;
            width: 100%;
            height: 280px;
            flex-grow: 1;
            margin-bottom: 4px;
            background: #000;
            border-bottom: 2px solid #ff00ff;
            border-left: 2px solid #ff00ff;
        }
        
        .connection-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.85); display: flex; align-items: center; justify-content: center; z-index: 9999; border-radius: 4px; }
        .connecting-text { font-family: 'Orbitron', sans-serif; font-size: 1rem; color: #ffea00; text-shadow: 0 0 10px #ffea00; animation: pulse 1.5s ease-in-out infinite; }
        @keyframes pulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
        #gameChart {
            width: 100%;
            height: 100%;
            display: block;
            /* OPTIMIZATION: GPU-accelerate canvas element */
            transform: translateZ(0);
            will-change: contents;
        }
        #glow {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 5;
            /* OPTIMIZATION: GPU-accelerate glow element */
            will-change: transform;
            transform: translateZ(0);
        }

        /* === ENHANCED NEON MULTIPLIER DISPLAY === */
        .multiplier-display {
            font-family: 'Orbitron', sans-serif;
            text-align: center;
            font-size: clamp(2rem, 9vw, 3.8rem);
            color: #ff00ea;
            margin: 2px 0;
            min-height: 48px;
            letter-spacing: 0;
            word-break: break-all;
            white-space: nowrap;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            /* White outline for contrast + neon glow */
            -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.95);
            /* OPTIMIZATION: Simplified text-shadow for GPU acceleration */
            text-shadow:
                0 0 10px #ff00ea,
                0 0 20px #ff00ff,
                2px 2px 6px rgba(0, 0, 0, 0.95);
            /* OPTIMIZATION: GPU-accelerate multiplier display */
            transform: translateZ(0);
            will-change: contents;
            position: relative;
        }
        /* Dark background behind text for extra contrast */
        .multiplier-display::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 120%;
            height: 140%;
            background: radial-gradient(ellipse, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 80%);
            z-index: -1;
            border-radius: 12px;
        }
        .multiplier-display.crash {
            color: #ff0055;
            -webkit-text-stroke: 1px rgba(255, 255, 255, 0.8);
            text-shadow:
                0 0 7px #ff0055,
                0 0 10px #ff0055,
                0 0 21px #ff0055,
                0 0 42px #ff0033,
                0 0 82px #ff0033,
                2px 2px 4px rgba(0, 0, 0, 0.8);
            /* Keep crashFlash but limit iterations */
            animation: crashFlash 0.5s ease-in-out 3;
        }
        .multiplier-display.cashout {
            color: #00ffcc;
            -webkit-text-stroke: 1px rgba(255, 255, 255, 0.8);
            text-shadow:
                0 0 7px #00ffcc,
                0 0 10px #00ffcc,
                0 0 21px #00ffcc,
                0 0 42px #00ff99,
                0 0 82px #00ff99,
                2px 2px 4px rgba(0, 0, 0, 0.8);
        }
        .multiplier-display.countdown {
            color: #ffea00;
            -webkit-text-stroke: 1px rgba(255, 255, 255, 0.8);
            text-shadow:
                0 0 7px #ffea00,
                0 0 10px #ffea00,
                0 0 21px #ffea00,
                0 0 42px #ffcc00,
                2px 2px 4px rgba(0, 0, 0, 0.8);
        }
        @keyframes neonBreath {
            0%, 100% {
                text-shadow:
                    0 0 7px #ff00ea,
                    0 0 10px #ff00ea,
                    0 0 21px #ff00ea,
                    0 0 42px #ff00ff,
                    0 0 82px #ff00ff,
                    0 0 92px #ff00ff;
            }
            50% {
                text-shadow:
                    0 0 10px #ff00ea,
                    0 0 15px #ff00ea,
                    0 0 30px #ff00ea,
                    0 0 60px #ff00ff,
                    0 0 100px #ff00ff,
                    0 0 120px #ff00ff;
            }
        }
        @keyframes crashFlash {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }
        .countdown-display {
            font-size: clamp(2rem, 9vw, 3.8rem);
            color: #ffea00;
            text-shadow:
                0 0 7px #ffea00,
                0 0 10px #ffea00,
                0 0 21px #ffea00,
                0 0 42px #ffcc00;
        }
        
        /* === 3D BEVELED RETRO BUTTONS === */
        .ui-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 6px; width: 100%; flex-shrink: 0; }
        .ui-item { display: flex; flex-direction: column; gap: 2px; }
        .label { font-size: 0.45rem; color: #ff00ff; font-weight: 900; text-shadow: 0 0 5px rgba(255, 0, 255, 0.5); }
        input {
            background: rgba(0, 0, 0, 0.6);
            border: 1px solid rgba(255, 0, 255, 0.5);
            color: #fff;
            padding: 8px 4px;
            font-family: 'Orbitron', sans-serif;
            text-align: center;
            outline: none;
            border-radius: 4px;
            font-size: max(16px, 0.75rem); /* Prevents iOS auto-zoom */
            width: 100%;
            -webkit-appearance: none;
            appearance: none;
            -webkit-user-select: auto;
            user-select: auto;
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
            touch-action: manipulation;
        }
        input:focus {
            border-color: #ff00ff;
            box-shadow:
                inset 0 2px 4px rgba(0, 0, 0, 0.5),
                0 0 8px rgba(255, 0, 255, 0.4);
        }

        /* === QUICK-SELECT BET AMOUNT BUTTONS === */
        .quick-bet-btns {
            display: flex;
            gap: 4px;
            margin-top: 4px;
            flex-wrap: wrap;
            justify-content: center;
        }
        .quick-bet-btn {
            flex: 1;
            min-width: 44px;
            padding: 6px 2px;
            font-family: 'Orbitron', sans-serif;
            font-size: 0.55rem;
            font-weight: 700;
            border: 1px solid rgba(255, 0, 255, 0.4);
            border-radius: 4px;
            background: rgba(255, 0, 255, 0.15);
            color: #ff88ff;
            cursor: pointer;
            transition: all 0.05s ease;
            -webkit-tap-highlight-color: transparent;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            touch-action: manipulation;
        }
        .quick-bet-btn:hover:not(:disabled) {
            background: rgba(255, 0, 255, 0.3);
            border-color: #ff00ff;
            color: #fff;
            box-shadow: 0 0 8px rgba(255, 0, 255, 0.3);
        }
        .quick-bet-btn:active:not(:disabled) {
            transform: scale(0.95);
            background: rgba(255, 0, 255, 0.4);
        }
        .quick-bet-btn:disabled {
            opacity: 0.3;
            cursor: not-allowed;
        }
        .quick-bet-btn.half-btn {
            border-color: rgba(0, 255, 255, 0.4);
            background: rgba(0, 255, 255, 0.15);
            color: #88ffff;
        }
        .quick-bet-btn.half-btn:hover:not(:disabled) {
            background: rgba(0, 255, 255, 0.3);
            border-color: #00ffff;
            color: #fff;
        }
        .quick-bet-btn.max-btn {
            border-color: rgba(255, 234, 0, 0.4);
            background: rgba(255, 234, 0, 0.15);
            color: #ffff88;
        }
        .quick-bet-btn.max-btn:hover:not(:disabled) {
            background: rgba(255, 234, 0, 0.3);
            border-color: #ffea00;
            color: #000;
        }

        button {
            /* height: 42px; */ /* Commented out to allow flexible button heights */
            min-height: 42px;
            font-family: 'Orbitron', sans-serif;
            font-weight: 900;
            font-size: 0.75rem;
            cursor: pointer;
            border: none;
            border-radius: 4px;
            width: 100%;
            transition: transform 0.05s ease, box-shadow 0.05s ease, background 0.05s ease, color 0.05s ease;
            -webkit-tap-highlight-color: transparent;
            position: relative;
            text-transform: uppercase;
            letter-spacing: 1px;
            touch-action: manipulation;
        }
        
        /* 3D Beveled Button Style */
        .btn-run {
            background: linear-gradient(180deg, #ff33ff 0%, #cc00cc 50%, #990099 100%);
            color: #fff;
            border-top: 2px solid rgba(255, 255, 255, 0.4);
            border-left: 2px solid rgba(255, 255, 255, 0.2);
            border-bottom: 2px solid rgba(0, 0, 0, 0.4);
            border-right: 2px solid rgba(0, 0, 0, 0.2);
            box-shadow:
                0 4px 0 #660066,
                0 6px 10px rgba(0, 0, 0, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
        }
        .btn-run:hover:not(:disabled) {
            background: linear-gradient(180deg, #ff66ff 0%, #dd33dd 50%, #aa33aa 100%);
            box-shadow:
                0 4px 0 #660066,
                0 6px 10px rgba(0, 0, 0, 0.5),
                0 0 15px rgba(255, 0, 255, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.4);
        }
        
        .btn-out {
            background: linear-gradient(180deg, #33ffff 0%, #00cccc 50%, #009999 100%);
            color: #000;
            border-top: 2px solid rgba(255, 255, 255, 0.5);
            border-left: 2px solid rgba(255, 255, 255, 0.3);
            border-bottom: 2px solid rgba(0, 0, 0, 0.3);
            border-right: 2px solid rgba(0, 0, 0, 0.15);
            box-shadow:
                0 4px 0 #006666,
                0 6px 10px rgba(0, 0, 0, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.4);
            text-shadow: 0 1px 1px rgba(255, 255, 255, 0.3);
        }
        .btn-out:hover:not(:disabled) {
            background: linear-gradient(180deg, #66ffff 0%, #33dddd 50%, #33aaaa 100%);
            box-shadow:
                0 4px 0 #006666,
                0 6px 10px rgba(0, 0, 0, 0.5),
                0 0 15px rgba(0, 255, 255, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
        }
        
        .btn-deposit {
            background: linear-gradient(180deg, #ffff33 0%, #cccc00 50%, #999900 100%);
            color: #000;
            border-top: 2px solid rgba(255, 255, 255, 0.5);
            border-left: 2px solid rgba(255, 255, 255, 0.3);
            border-bottom: 2px solid rgba(0, 0, 0, 0.3);
            border-right: 2px solid rgba(0, 0, 0, 0.15);
            box-shadow:
                0 4px 0 #666600,
                0 6px 10px rgba(0, 0, 0, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.4);
            text-shadow: 0 1px 1px rgba(255, 255, 255, 0.3);
        }
        .btn-deposit:hover:not(:disabled) {
            background: linear-gradient(180deg, #ffff66 0%, #dddd33 50%, #aaaa33 100%);
            box-shadow:
                0 4px 0 #666600,
                0 6px 10px rgba(0, 0, 0, 0.5),
                0 0 15px rgba(255, 234, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
        }
        
        .btn-withdraw {
            background: linear-gradient(180deg, #ff3366 0%, #cc0044 50%, #990033 100%);
            color: #fff;
            border-top: 2px solid rgba(255, 255, 255, 0.4);
            border-left: 2px solid rgba(255, 255, 255, 0.2);
            border-bottom: 2px solid rgba(0, 0, 0, 0.4);
            border-right: 2px solid rgba(0, 0, 0, 0.2);
            box-shadow:
                0 4px 0 #660022,
                0 6px 10px rgba(0, 0, 0, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
        }
        .btn-withdraw:hover:not(:disabled) {
            background: linear-gradient(180deg, #ff6688 0%, #dd3366 50%, #aa3355 100%);
            box-shadow:
                0 4px 0 #660022,
                0 6px 10px rgba(0, 0, 0, 0.5),
                0 0 15px rgba(255, 0, 85, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.4);
        }
        
        button:active:not(:disabled) {
            transform: translateY(3px);
            box-shadow:
                0 1px 0 #333,
                inset 0 2px 4px rgba(0, 0, 0, 0.3);
            border-top: 2px solid rgba(0, 0, 0, 0.3);
            border-left: 2px solid rgba(0, 0, 0, 0.15);
            border-bottom: 2px solid rgba(255, 255, 255, 0.2);
            border-right: 2px solid rgba(255, 255, 255, 0.1);
        }
        button:disabled {
            filter: grayscale(1);
            opacity: 0.15;
            cursor: not-allowed;
        }

        /* === NETWORK STATUS NEON INDICATOR === */
        .network-status {
            margin-top: 6px;
            padding: 4px 6px;
            background: rgba(0, 0, 0, 0.4);
            border-radius: 4px;
            font-size: 0.6rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-shrink: 0;
        }
        .status-online {
            color: #00ff00;
            position: relative;
            padding-left: 12px;
        }
        .status-online::before {
            content: '';
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: #00ff00;
            box-shadow: 0 0 6px #00ff00, 0 0 12px rgba(0, 255, 0, 0.5);
            /* OPTIMIZATION: Disable pulse animation for status indicator */
            /* animation: pulseDot 1.5s ease-in-out infinite; */
        }
        .status-offline {
            color: #ff0055;
            position: relative;
            padding-left: 12px;
        }
        .status-offline::before {
            content: '';
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: #ff0055;
            box-shadow: 0 0 6px #ff0055;
            /* OPTIMIZATION: Keep blinkDot but it's less expensive */
            animation: blinkDot 0.5s ease-in-out infinite;
        }
        @keyframes pulseDot {
            0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
            50% { opacity: 0.5; transform: translateY(-50%) scale(0.8); }
        }
        @keyframes blinkDot {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.2; }
        }
        
        /* === RETRO LOADING ANIMATION === */
        .connecting-text {
            position: relative;
        }
        .connecting-text::after {
            content: '';
            animation: loadingDots 1.5s steps(4, end) infinite;
        }
        @keyframes loadingDots {
            0% { content: ''; }
            25% { content: '.'; }
            50% { content: '..'; }
            75% { content: '...'; }
            100% { content: ''; }
        }
        .terminal-cursor {
            display: inline-block;
            width: 8px;
            height: 14px;
            background: #ffea00;
            margin-left: 4px;
            /* OPTIMIZATION: Disable cursor blink for performance */
            /* animation: blinkCursor 0.8s step-end infinite; */
            vertical-align: middle;
        }
        @keyframes blinkCursor {
            0%, 100% { opacity: 1; }
            50% { opacity: 0; }
        }
        
        /* === HISTORY BAR SCROLL GLOW === */
        .history-bar {
            position: relative;
        }
        .history-bar::after {
            content: '';
            position: absolute;
            right: 0;
            top: 0;
            bottom: 0;
            width: 20px;
            pointer-events: none;
        }
        .history-bar::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 20px;
            pointer-events: none;
            z-index: 1;
        }
        
        /* === BUTTON RIPPLE EFFECT === */
        button {
            position: relative;
            overflow: hidden;
        }
        button .ripple {
            position: absolute;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.4);
            transform: scale(0);
            animation: rippleEffect 0.6s linear;
            pointer-events: none;
        }
        @keyframes rippleEffect {
            to {
                transform: scale(4);
                opacity: 0;
            }
        }
        
        /* Sequence number display for debugging */
        .seq-display {
            position: absolute;
            top: 5px;
            right: 5px;
            font-size: 0.6rem;
            color: rgba(255, 234, 0, 0.7);
            background: rgba(0, 0, 0, 0.7);
            padding: 2px 5px;
            border-radius: 3px;
            font-family: 'Fira Code', monospace;
        }

        /* Live bet counter */
        .bet-counter {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 4px 8px;
            background: rgba(255, 0, 234, 0.1);
            border-radius: 4px;
            font-size: 0.7rem;
            margin-bottom: 8px;
            flex-shrink: 0;
            text-align: center;
        }
        .bet-counter-icon { color: #ff00ea; }
        .bet-counter-count { font-weight: 900; color: #fff; }

        /* Modal for betting outside countdown */
        .modal-overlay {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0, 0, 0, 0.85);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 10000;
            backdrop-filter: blur(4px);
        }
        .modal-overlay.active { display: flex; }
        .modal {
            background: linear-gradient(145deg, rgba(10, 10, 30, 0.98) 0%, rgba(5, 5, 20, 0.99) 100%);
            border: 2px solid #ff00ff;
            border-radius: 12px;
            padding: 20px;
            max-width: 320px;
            width: 92%;
            text-align: center;
            box-shadow: 0 0 40px rgba(255, 0, 255, 0.3), 0 10px 30px rgba(0, 0, 0, 0.5);
        }
        .modal h3 {
            color: #ff00ff;
            margin-bottom: 12px;
            font-size: 0.9rem;
            text-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
            letter-spacing: 1px;
        }
        .modal p { color: #fff; font-size: 0.8rem; margin-bottom: 12px; line-height: 1.5; }
        .modal button {
            width: 100%;
            height: 38px;
            margin-top: 8px;
        }
        .modal-checkbox {
            display: flex;
            align-items: center;
            gap: 6px;
            justify-content: center;
            margin-bottom: 12px;
            font-size: 0.7rem;
            color: #ccc;
        }
        .modal-checkbox input { width: auto; }

        /* TON Connect Wallet Button Container */
        #tonconnect-container {
            position: absolute;
            top: 12px;
            right: 12px;
            z-index: 100;
        }

        /* Wallet Connection Section Button - taller height */
        #walletConnectionSection button {
            height: 56px !important;
            min-height: 56px !important;
            font-size: 0.85rem !important;
            line-height: 1.2 !important;
            padding: 12px 16px !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
        }

        /* TON Connect Modal Button Overrides - Global */
        button {
            height: auto !important;
            min-height: 42px !important;
        }

        /* TON Connect Modal Specific Overrides */
        .tc-modal button,
        [class*="tc-modal"] button,
        [class*="ton-connect"] button,
        [class*="tonconnect"] button {
            height: auto !important;
            min-height: 52px !important;
            padding: 14px 16px !important;
            line-height: 1.3 !important;
            white-space: normal !important;
            word-wrap: break-word !important;
        }

        /* TON Connect Wallet Item Buttons */
        .tc-wallets__wallet-button,
        [class*="wallet-button"],
        [class*="wallets__item"],
        [class*="wallet-item"] {
            height: auto !important;
            min-height: 56px !important;
            padding: 12px 16px !important;
            display: flex !important;
            align-items: center !important;
            justify-content: flex-start !important;
            gap: 12px !important;
        }

        /* TON Connect Modal Content Area */
        .tc-modal__content,
        [class*="tc-modal__content"],
        [class*="ton-connect-modal__content"] {
            overflow-y: auto !important;
            max-height: calc(100dvh - 40px) !important;
        }

        /* TON Connect Modal Container */
        .tc-modal__container,
        [class*="tc-modal__container"],
        [class*="ton-connect-modal__container"] {
            max-height: 95dvh !important;
            overflow-y: auto !important;
        }

        /* TON Connect Modal Header/Title */
        .tc-modal__header,
        [class*="tc-modal__header"],
        [class*="ton-connect-modal"] .modal-header {
            min-height: 44px !important;
            height: auto !important;
            padding: 12px 16px !important;
        }

        /* TON Connect Modal Footer/Actions */
        .tc-modal__footer,
        [class*="tc-modal__footer"],
        [class*="ton-connect-modal"] .modal-footer {
            min-height: 48px !important;
            height: auto !important;
            padding: 12px 16px !important;
        }

        /* TON Connect Modal Fixes */
        .tc-modal,
        [class*="ton-connect-modal"],
        [class*="tc-modal"] {
            max-height: 100dvh !important;
            overflow-y: auto !important;
        }

        /* Fix wallet list being cut off */
        .tc-modal__content,
        [class*="tc-modal__content"],
        [class*="ton-connect-modal__content"] {
            overflow-y: auto !important;
            max-height: calc(100dvh - 40px) !important;
        }

        /* Ensure wallet list items are fully visible */
        .tc-wallets,
        [class*="tc-wallets"],
        [class*="ton-connect-wallets"] {
            overflow-y: visible !important;
            max-height: none !important;
        }

        /* Fix modal container overflow */
        .tc-modal__container,
        [class*="tc-modal__container"],
        [class*="ton-connect-modal__container"] {
            overflow-y: auto !important;
            max-height: 100dvh !important;
        }

        /* Ensure modal is not clipped by parent */
        body > div[class*="tc-"],
        body > div[class*="ton-connect-"] {
            position: fixed !important;
            z-index: 999999 !important;
        }

        /* Wallet Info Display */
        .wallet-info {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 6px 12px;
            background: rgba(255, 234, 0, 0.1);
            border: 1px solid #ffea00;
            border-radius: 4px;
            font-size: 0.7rem;
            margin-bottom: 8px;
        }
        .wallet-address {
            font-family: 'Fira Code', monospace;
            color: #fff;
            font-size: 0.65rem;
            word-break: break-all;
        }
        .disconnect-btn {
            background: rgba(255, 0, 85, 0.3);
            border: 1px solid #ff0055;
            color: #ff0055;
            padding: 4px 8px;
            font-size: 0.6rem;
            cursor: pointer;
            border-radius: 3px;
            transition: 0.2s;
        }
        .disconnect-btn:hover {
            background: rgba(255, 0, 85, 0.5);
            color: #fff;
        }

        /* Deposit Modal Styles */
        .deposit-modal-overlay.active { display: flex; }
        .deposit-modal-overlay {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0, 0, 0, 0.85);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 10000;
            backdrop-filter: blur(4px);
        }
        .deposit-modal {
            background: linear-gradient(145deg, rgba(10, 10, 30, 0.98) 0%, rgba(5, 5, 20, 0.99) 100%);
            border: 2px solid #ffea00;
            border-radius: 12px;
            padding: 20px;
            max-width: 340px;
            width: 94%;
            text-align: center;
            display: flex;
            flex-direction: column;
            max-height: calc(100vh - 40px);
            overflow-y: auto;
            box-shadow: 0 0 40px rgba(255, 234, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.5);
        }
        .deposit-modal h3 {
            color: #ffea00;
            margin-bottom: 12px;
            font-size: 1rem;
            text-shadow: 0 0 10px rgba(255, 234, 0, 0.5);
            letter-spacing: 1px;
        }
        .deposit-amount-inputs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
        .deposit-amount-btn {
            height: 36px;
            font-size: 0.7rem;
            background: rgba(255, 234, 0, 0.2);
            border: 1px solid rgba(255, 234, 0, 0.5);
            color: #ffea00;
            border-radius: 6px;
            transition: all 0.2s ease;
        }
        .deposit-amount-btn:hover {
            background: rgba(255, 234, 0, 0.4);
            box-shadow: 0 0 10px rgba(255, 234, 0, 0.3);
        }
        .custom-amount-input {
            width: 100%;
            margin-bottom: 12px;
            background: rgba(0, 0, 0, 0.5);
            border: 1px solid rgba(255, 234, 0, 0.4);
            color: #fff;
            padding: 8px 10px;
            border-radius: 6px;
            font-family: 'Orbitron', sans-serif;
            font-size: max(16px, 0.75rem); /* Prevents iOS auto-zoom */
            text-align: center;
            outline: none;
            -webkit-user-select: auto;
            user-select: auto;
        }
        .custom-amount-input:focus {
            border-color: #ffea00;
            box-shadow: 0 0 10px rgba(255, 234, 0, 0.3);
        }
        .deposit-address-box {
            background: rgba(0, 0, 0, 0.4);
            border: 1px solid #ffea00;
            border-radius: 6px;
            padding: 10px;
            margin-bottom: 12px;
        }
        .deposit-address-label { font-size: 0.55rem; color: #ffea00; margin-bottom: 6px; display: block; }
        .deposit-address-value {
            font-family: 'Fira Code', monospace;
            font-size: 0.65rem;
            color: #fff;
            word-break: break-all;
            line-height: 1.4;
            max-height: 50px;
            overflow-y: auto;
            -webkit-user-select: text;
            user-select: text;
        }
        .deposit-info { font-size: 0.65rem; color: #aaa; margin-bottom: 12px; line-height: 1.5; }
        .deposit-tx-hash {
            background: rgba(255, 234, 0, 0.1);
            border: 1px dashed #ffea00;
            padding: 6px;
            margin-bottom: 12px;
            font-family: 'Fira Code', monospace;
            font-size: 0.6rem;
            color: #ffea00;
            word-break: break-all;
        }
        .deposit-status {
            padding: 6px;
            border-radius: 4px;
            margin-bottom: 12px;
            font-size: 0.65rem;
        }
        .status-pending { background: rgba(255, 234, 0, 0.2); color: #ffea00; border: 1px solid #ffea00; }
        .status-confirmed { background: rgba(0, 255, 0, 0.2); color: #00ff00; border: 1px solid #00ff00; }
        .status-expired { background: rgba(255, 0, 85, 0.2); color: #ff0055; border: 1px solid #ff0055; }

        /* Deposit modal step content and footer */
        .deposit-step-content {
            overflow-y: auto;
            flex-grow: 1;
            min-height: 0;
        }
        .deposit-modal-footer {
            position: sticky;
            bottom: 0;
            background: linear-gradient(180deg, transparent 0%, rgba(26, 26, 46, 0.95) 100%);
            padding-top: 12px;
            margin-top: -12px;
        }
        
        /* Scrollbar styling for deposit modal */
        .deposit-modal::-webkit-scrollbar {
            width: 8px;
        }
        .deposit-modal::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.3);
            border-radius: 4px;
        }
        .deposit-modal::-webkit-scrollbar-thumb {
            background: #ffea00;
            border-radius: 4px;
        }
        .deposit-modal::-webkit-scrollbar-thumb:hover {
            background: #ccaa00;
        }

        /* Balance Display */
        .balance-display {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 8px;
            background: rgba(255, 234, 0, 0.1);
            border-radius: 4px;
            margin-bottom: 8px;
            font-size: 0.7rem;
        }
        .balance-icon { color: #ffea00; }
        .balance-amount { font-weight: 900; color: #fff; font-size: 0.85rem; }

        /* Notification styles */
        .notification {
            position: fixed;
            top: calc(var(--tg-safe-area-top, env(safe-area-inset-top, 20px)) + 10px);
            right: 10px;
            left: 10px;
            max-width: calc(100% - 20px);
            background: #1a1a2e;
            border: 2px solid #ff00ea;
            color: #fff;
            padding: 12px 16px;
            border-radius: 8px;
            z-index: 9999;
            font-family: 'Fira Code', monospace;
            animation: slideIn 0.3s ease-out;
            pointer-events: none;
        }

        /* OPTIMIZATION: GPU-accelerate multiplier container */
        .multiplier-container {
            transform: translateZ(0);
            will-change: auto;
        }
        
        /* Cashout Float Animation */
        .multiplier-container {
            position: relative;
            width: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            margin: 2px 0;
            min-height: 55px;
        }

        .cashout-float {
            position: absolute;
            font-family: 'Orbitron', sans-serif;
            font-weight: 900;
            font-size: 1.2rem;
            pointer-events: none;
            z-index: 100;
            /* OPTIMIZATION: GPU-accelerate cashout animation */
            transform: translateZ(0);
            will-change: transform, opacity;
            text-shadow: 0 0 10px currentColor;
            animation: cashoutFall 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
        }

        @keyframes cashoutFall {
            0% { transform: translateY(0) scale(1.2); opacity: 0; }
            10% { opacity: 1; }
            100% { transform: translateY(60px) scale(0.8); opacity: 0; }
        }

        @keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

        /* Live Bets Table - Modern Card Style */
        .live-bets-table {
            background: linear-gradient(145deg, rgba(10, 10, 30, 0.95) 0%, rgba(5, 5, 20, 0.98) 100%);
            border: 1px solid rgba(255, 0, 234, 0.25);
            border-radius: 10px;
            margin-top: 8px;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            max-height: 180px;
            flex-shrink: 0;
            box-shadow: 0 4px 20px rgba(255, 0, 234, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
        }
        .bets-header {
            display: grid;
            grid-template-columns: 2fr 1fr 1fr 1fr;
            padding: 10px 14px;
            background: linear-gradient(90deg, rgba(255, 0, 234, 0.12) 0%, rgba(0, 255, 255, 0.08) 100%);
            border-bottom: 1px solid rgba(255, 0, 234, 0.3);
            font-size: 0.5rem;
            color: rgba(255, 0, 234, 0.8);
            font-weight: 900;
            letter-spacing: 1px;
            text-transform: uppercase;
        }
        .bets-body {
            overflow-y: auto;
            scrollbar-width: thin;
            scrollbar-color: rgba(255, 0, 234, 0.4) transparent;
            min-height: 50px;
            overscroll-behavior: contain;
            -webkit-overflow-scrolling: touch;
        }
        .bets-body::-webkit-scrollbar { width: 4px; }
        .bets-body::-webkit-scrollbar-track { background: transparent; }
        .bets-body::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(255, 0, 234, 0.6), rgba(0, 255, 255, 0.4)); border-radius: 4px; }
        
        /* Modern Card Row Style */
        .bet-row {
            display: grid;
            grid-template-columns: 2fr 1fr 1fr 1fr;
            padding: 10px 14px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.04);
            font-size: 0.6rem;
            align-items: center;
            color: #fff;
            transition: all 0.25s ease;
            position: relative;
        }
        .bet-row::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 3px;
            background: transparent;
            transition: background 0.25s ease;
        }
        .bet-row:hover {
            background: rgba(255, 0, 234, 0.06);
        }
        .bet-row:hover::before {
            background: rgba(255, 0, 234, 0.5);
        }
        .bet-row.cashed-out {
            background: linear-gradient(90deg, rgba(0, 255, 204, 0.05) 0%, transparent 100%);
        }
        .bet-row.cashed-out::before {
            background: #00ffcc;
        }
        .bet-row.cashed-out:hover {
            background: linear-gradient(90deg, rgba(0, 255, 204, 0.1) 0%, transparent 100%);
        }
        .bet-player {
            font-family: 'Fira Code', monospace;
            color: rgba(255, 255, 255, 0.6);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            padding-right: 8px;
            letter-spacing: 0;
            font-size: 0.58rem;
        }
        .bet-row.cashed-out .bet-player {
            color: #00ffcc;
            font-weight: 700;
        }
        .bet-amount {
            font-weight: 600;
            text-align: center;
            color: rgba(255, 255, 255, 0.85);
            font-size: 0.58rem;
        }
        .bet-mult {
            font-weight: 900;
            text-align: center;
            font-size: 0.58rem;
        }
        .bet-win {
            font-weight: 700;
            text-align: right;
            color: #00ff88;
            font-size: 0.58rem;
        }
        .no-bets-msg {
            padding: 24px;
            text-align: center;
            color: rgba(255,255,255,0.2);
            font-size: 0.55rem;
            letter-spacing: 1.5px;
        }

        /* History Tabs */
        .history-tabs {
            display: flex;
            gap: 8px;
            margin-bottom: 10px;
        }
        .history-tab-btn {
            flex: 1;
            padding: 8px 12px;
            background: linear-gradient(145deg, rgba(10, 10, 30, 0.9) 0%, rgba(5, 5, 20, 0.95) 100%);
            border: 1px solid rgba(0, 255, 255, 0.2);
            border-radius: 8px;
            color: rgba(0, 255, 255, 0.6);
            font-size: 0.55rem;
            font-weight: 900;
            letter-spacing: 1px;
            text-transform: uppercase;
            cursor: pointer;
            transition: all 0.25s ease;
        }
        .history-tab-btn:hover {
            background: linear-gradient(145deg, rgba(10, 10, 30, 0.95) 0%, rgba(5, 5, 20, 0.98) 100%);
            border-color: rgba(0, 255, 255, 0.4);
            color: rgba(0, 255, 255, 0.9);
        }
        .history-tab-btn.active {
            background: linear-gradient(145deg, rgba(0, 255, 255, 0.15) 0%, rgba(255, 0, 234, 0.1) 100%);
            border-color: rgba(0, 255, 255, 0.5);
            color: #00ffff;
            box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
        }
        .history-panel {
            display: none;
        }
        .history-panel.active {
            display: block;
        }

        /* Game History Table - Modern Card Style */
        .history-table {
            background: linear-gradient(145deg, rgba(10, 10, 30, 0.95) 0%, rgba(5, 5, 20, 0.98) 100%);
            border: 1px solid rgba(0, 255, 255, 0.2);
            border-radius: 10px;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            max-height: 240px;
            flex-shrink: 0;
            box-shadow: 0 4px 20px rgba(0, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
        }
        .history-header {
            display: grid;
            grid-template-columns: 1fr 1.2fr 1fr;
            padding: 10px 14px;
            background: linear-gradient(90deg, rgba(0, 255, 255, 0.1) 0%, rgba(255, 0, 234, 0.08) 100%);
            border-bottom: 1px solid rgba(0, 255, 255, 0.25);
            font-size: 0.5rem;
            color: rgba(0, 255, 255, 0.7);
            font-weight: 900;
            letter-spacing: 1px;
            text-transform: uppercase;
        }
        .history-body {
            overflow-y: auto;
            scrollbar-width: thin;
            scrollbar-color: rgba(0, 255, 255, 0.4) transparent;
            min-height: 50px;
            overscroll-behavior: contain;
            -webkit-overflow-scrolling: touch;
        }
        .history-body::-webkit-scrollbar { width: 4px; }
        .history-body::-webkit-scrollbar-track { background: transparent; }
        .history-body::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(0, 255, 255, 0.6), rgba(255, 0, 234, 0.4)); border-radius: 4px; }
        
        .history-row {
            display: grid;
            grid-template-columns: 1fr 1.2fr 1fr;
            padding: 10px 14px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.04);
            font-size: 0.58rem;
            align-items: center;
            color: #fff;
            transition: all 0.25s ease;
            position: relative;
        }
        .history-row::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 3px;
            background: transparent;
            transition: background 0.25s ease;
        }
        .history-row:hover {
            background: rgba(0, 255, 255, 0.06);
        }
        .history-row:hover::before {
            background: rgba(0, 255, 255, 0.5);
        }
        
        /* Fix for mobile: use :active instead of :hover on touch devices */
        @media (hover: none) and (pointer: coarse) {
            .history-row:hover {
                background: transparent;
            }
            .history-row:hover::before {
                background: transparent;
            }
            .history-row:active {
                background: rgba(0, 255, 255, 0.06);
            }
            .history-row:active::before {
                background: rgba(0, 255, 255, 0.5);
            }
        }
        .history-mult {
            font-weight: 900;
            text-align: left;
            letter-spacing: 0;
            border: none !important;
            box-shadow: none !important;
            text-shadow: none !important;
            padding: 2px 6px;
            border-radius: 3px;
            display: inline-block;
            max-width: 70px;
            white-space: nowrap;
        }
        .history-row .m-low {
            color: #ff0055;
            border: 1px solid rgba(255, 0, 85, 0.4);
            box-shadow: 0 0 3px rgba(255, 0, 85, 0.2);
        }
        .history-row .m-mid {
            color: #00ffff;
            border: 1px solid rgba(0, 255, 255, 0.4);
            box-shadow: 0 0 3px rgba(0, 255, 255, 0.2);
        }
        .history-row .m-high {
            color: #cc00ff;
            border: 1px solid rgba(204, 0, 255, 0.4);
            box-shadow: 0 0 3px rgba(204, 0, 255, 0.2);
        }
        .history-row .m-moon {
            color: #ffea00;
            border: 1px solid rgba(255, 234, 0, 0.5);
            box-shadow: 0 0 5px rgba(255, 234, 0, 0.3);
        }
        .history-id-cell {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
        .history-id {
            font-family: 'Fira Code', monospace;
            color: rgba(255, 255, 255, 0.5);
            font-size: 0.55rem;
            cursor: pointer;
            transition: color 0.2s;
            -webkit-user-select: text;
            user-select: text;
        }
        .history-id:hover { color: #0ff; }
        .history-actions {
            display: flex;
            justify-content: flex-end;
            gap: 4px;
        }
        .history-action-btn {
            width: 26px;
            height: 26px;
            border-radius: 6px;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.7rem;
            transition: all 0.2s ease;
            background: rgba(255, 255, 255, 0.05);
        }
        .history-action-btn:hover {
            transform: scale(1.1);
            background: rgba(255, 255, 255, 0.1);
        }
        .history-action-btn.btn-verify { color: #ff00ea; }
        .history-action-btn.btn-verify:hover { background: rgba(255, 0, 234, 0.2); }
        .history-action-btn.btn-info { color: #00ffea; }
        .history-action-btn.btn-info:hover { background: rgba(0, 255, 234, 0.2); }

        /* Player Operations History - Scrollable Container */
        .player-history-scroll-wrapper {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: thin;
            scrollbar-color: rgba(0, 255, 255, 0.4) transparent;
            overscroll-behavior: contain;
        }
        .player-history-scroll-wrapper::-webkit-scrollbar {
            height: 6px;
        }
        .player-history-scroll-wrapper::-webkit-scrollbar-track {
            background: transparent;
        }
        .player-history-scroll-wrapper::-webkit-scrollbar-thumb {
            background: linear-gradient(90deg, rgba(0, 255, 255, 0.6), rgba(255, 0, 234, 0.4));
            border-radius: 3px;
        }
        
        /* Player Operations Header - uses min-width for horizontal scroll */
        .player-history-header {
            display: flex;
            min-width: 500px;
            padding: 10px 14px;
            background: linear-gradient(90deg, rgba(0, 255, 255, 0.1) 0%, rgba(255, 0, 234, 0.08) 100%);
            border-bottom: 1px solid rgba(0, 255, 255, 0.25);
            font-size: 0.5rem;
            color: rgba(0, 255, 255, 0.7);
            font-weight: 900;
            letter-spacing: 1px;
            text-transform: uppercase;
        }
        .player-history-header > span:nth-child(1) { flex: 0 0 70px; }   /* TYPE */
        .player-history-header > span:nth-child(2) { flex: 0 0 80px; }   /* GAME / TX */
        .player-history-header > span:nth-child(3) { flex: 0 0 75px; }   /* AMOUNT */
        .player-history-header > span:nth-child(4) { flex: 0 0 70px; }   /* CASHOUT */
        .player-history-header > span:nth-child(5) { flex: 0 0 90px; }   /* DATE */
        .player-history-header > span:nth-child(6) { flex: 1; }          /* ACTIONS / STATUS */
        
        /* Player Operations Row - uses flex for horizontal scroll */
        .player-history-row {
            display: flex;
            min-width: 500px;
            padding: 10px 14px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.04);
            font-size: 0.58rem;
            align-items: center;
            color: #fff;
            transition: all 0.25s ease;
            position: relative;
        }
        .player-history-row > span:nth-child(1) { flex: 0 0 70px; }      /* TYPE */
        .player-history-row > span:nth-child(2) { flex: 0 0 80px; }      /* GAME / TX */
        .player-history-row > span:nth-child(3) { flex: 0 0 75px; }      /* AMOUNT */
        .player-history-row > span:nth-child(4) { flex: 0 0 70px; }      /* CASHOUT */
        .player-history-row > span:nth-child(5) { flex: 0 0 90px; }      /* DATE */
        .player-history-row > span:nth-child(6) { flex: 1; }             /* ACTIONS / STATUS */
        
        .player-history-row::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 3px;
            background: transparent;
            transition: background 0.25s ease;
        }
        .player-history-row:hover {
            background: rgba(0, 255, 255, 0.06);
        }
        .player-history-row:hover::before {
            background: rgba(0, 255, 255, 0.5);
        }
        .player-history-row .bet-won {
            color: #00ff88;
            font-weight: 700;
        }
        .player-history-row .bet-lost {
            color: #ff0055;
            font-weight: 700;
        }
        .player-history-row .bet-cashed {
            color: #00ffff;
        }
        .player-history-row .bet-not-cashed {
            color: rgba(255, 255, 255, 0.3);
        }
        .player-history-actions {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 4px;
            white-space: nowrap;
        }

        /* Provably Fair Modal */
        .provably-fair-modal-overlay {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0, 0, 0, 0.85);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 10000;
            backdrop-filter: blur(4px);
        }
        .provably-fair-modal-overlay.active { display: flex; }
        .provably-fair-modal {
            background: linear-gradient(145deg, rgba(10, 10, 30, 0.98) 0%, rgba(5, 5, 20, 0.99) 100%);
            border: 2px solid #ffea00;
            border-radius: 12px;
            padding: 20px;
            max-width: 340px;
            width: 94%;
            box-shadow: 0 0 40px rgba(255, 234, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.5);
            display: flex;
            flex-direction: column;
            max-height: calc(100vh - 40px);
            overflow-y: auto;
        }
        .provably-fair-modal h3 {
            color: #ffea00;
            margin-bottom: 12px;
            font-size: 0.9rem;
            text-align: center;
            letter-spacing: 1.5px;
            flex-shrink: 0;
            text-shadow: 0 0 10px rgba(255, 234, 0, 0.5);
        }
        .pf-info-row {
            background: rgba(0, 0, 0, 0.5);
            border: 1px solid rgba(255, 234, 0, 0.3);
            border-radius: 6px;
            padding: 10px;
            margin-bottom: 8px;
        }
        .pf-info-label {
            font-size: 0.5rem;
            color: #ffea00;
            margin-bottom: 4px;
            display: block;
            letter-spacing: 0.8px;
        }
        .pf-info-value {
            font-family: 'Fira Code', monospace;
            font-size: 0.6rem;
            color: #fff;
            word-break: break-all;
            line-height: 1.35;
            max-height: 60px;
            overflow-y: auto;
            -webkit-user-select: text;
            user-select: text;
        }
        .pf-buttons {
            display: grid;
            gap: 6px;
            margin-top: 12px;
            flex-shrink: 0;
            position: sticky;
            bottom: 0;
            background: linear-gradient(180deg, transparent 0%, rgba(10, 10, 30, 0.95) 100%);
            padding-top: 12px;
        }
        .pf-btn {
            height: 38px;
            font-family: 'Orbitron', sans-serif;
            font-weight: 900;
            font-size: 0.65rem;
            cursor: pointer;
            border-radius: 6px;
            transition: all 0.2s ease;
        }
        .pf-btn-primary { background: linear-gradient(180deg, #ffea00 0%, #ccaa00 100%); color: #000; box-shadow: 0 3px 0 #997700; }
        .pf-btn-secondary { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.3); color: #fff; }
        .pf-btn:hover:not(.pf-btn-secondary) { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(255, 234, 0, 0.4); }
        .pf-explanation {
            font-size: 0.6rem;
            color: #aaa;
            margin-top: 10px;
            line-height: 1.5;
            background: rgba(255, 234, 0, 0.05);
            padding: 8px;
            border-radius: 6px;
            border-left: 2px solid #ffea00;
        }

        /* Mobile/Telegram App Optimizations */
        @media (max-width: 420px) {
            .game-container {
                width: 98%;
                max-width: 360px;
                padding: 6px 4px 4px !important;
            }
            .logo-wrap { height: 35px; }
            .logo-text, .logo-80s { font-size: 1rem; }
            .chart-wrapper { height: 260px; }
            .multiplier-display { min-height: 42px; font-size: clamp(1.5rem, 7vw, 3rem); letter-spacing: 0; }
            .bet-counter { padding: 3px 6px; font-size: 0.65rem; gap: 4px; }
            .live-bets-table { max-height: 140px; }
            .history-table { max-height: 180px; }
            .bets-header, .history-header { padding: 8px 10px; }
            .bet-row, .history-row { padding: 8px 10px; font-size: 0.55rem; }
            .history-action-btn { width: 24px; height: 24px; font-size: 0.65rem; }
        }

        /* Telegram Web App Full Screen Fix */
        @media (max-height: 700px) and (orientation: portrait) {
            .game-container {
                max-height: calc(100vh - var(--tg-safe-area-top, env(safe-area-inset-top, 20px)) - var(--tg-safe-area-bottom, env(safe-area-inset-bottom, 20px)));
                overflow-y: auto;
            }
            .chart-wrapper { height: 240px; }
        }

        /* Telegram Web App Specific Fixes */
        /* Ensure content is not hidden behind Telegram's header and notch */
        body {
            padding-top: var(--tg-safe-area-top, env(safe-area-inset-top, 0px));
            padding-bottom: var(--tg-safe-area-bottom, env(safe-area-inset-bottom, 0px));
            padding-left: var(--tg-safe-area-left, env(safe-area-inset-left, 0px));
            padding-right: var(--tg-safe-area-right, env(safe-area-inset-right, 0px));
        }
        
        /* Add extra top margin for Telegram's header buttons */
        .game-container {
            margin-top: max(16px, var(--tg-safe-area-top, env(safe-area-inset-top, 16px)));
        }
        
        /* Ensure modals are properly positioned */
        .modal-overlay,
        .deposit-modal-overlay,
        .provably-fair-modal-overlay {
            padding-top: var(--tg-safe-area-top, env(safe-area-inset-top, 0px));
            padding-bottom: var(--tg-safe-area-bottom, env(safe-area-inset-bottom, 0px));
        }
        
        .modal,
        .deposit-modal,
        .provably-fair-modal {
            max-height: calc(100dvh - var(--tg-safe-area-top, env(safe-area-inset-top, 0px)) - var(--tg-safe-area-bottom, env(safe-area-inset-bottom, 0px)) - 40px);
            margin-top: var(--tg-safe-area-top, env(safe-area-inset-top, 0px));
        }
        
        /* Telegram greeting */
        #tg-greeting {
            position: fixed;
            top: calc(var(--tg-safe-area-top, 0px) + 20px);
            left: 50%;
            transform: translateX(-50%);
            background: linear-gradient(135deg, #0088cc, #00aaff);
            color: #fff;
            padding: 12px 24px;
            border-radius: 12px;
            font-size: 18px;
            font-family: 'Orbitron', sans-serif;
            box-shadow: 0 4px 20px rgba(0, 136, 204, 0.4);
            z-index: 1000;
            opacity: 1;
            transition: opacity 0.5s ease;
            text-align: center;
            pointer-events: none;
        }
        
        #tg-greeting strong {
            color: #ffdd00;
        }

        /* === FIRST-VISIT TUTORIAL OVERLAY === */
        .tutorial-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.85);
            z-index: 20000;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s ease;
        }
        .tutorial-overlay.active {
            opacity: 1;
            pointer-events: auto;
        }
        .tutorial-card {
            background: linear-gradient(135deg, #1a1a2e 0%, #0a0a19 100%);
            border: 2px solid #ff00ff;
            border-radius: 16px;
            padding: 24px;
            max-width: 320px;
            width: 90%;
            box-shadow: 0 0 40px rgba(255, 0, 255, 0.3), 0 8px 32px rgba(0, 0, 0, 0.5);
            text-align: center;
            transform: scale(0.9);
            transition: transform 0.3s ease;
            position: relative;
            user-select: none;
            -webkit-user-select: none;
            -webkit-touch-callout: none;
        }
        .tutorial-overlay.active .tutorial-card {
            transform: scale(1);
        }
        .tutorial-step-number {
            font-family: 'Orbitron', sans-serif;
            font-size: 0.6rem;
            color: #ff00ff;
            text-transform: uppercase;
            letter-spacing: 2px;
            margin-bottom: 8px;
        }
        .tutorial-title {
            font-family: 'Orbitron', sans-serif;
            font-size: 1.1rem;
            font-weight: 900;
            background: linear-gradient(180deg, #ffffff 0%, #a0a0a0 100%);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            margin-bottom: 12px;
        }
        .tutorial-description {
            font-family: 'Fira Code', monospace;
            font-size: 0.75rem;
            color: #ccc;
            line-height: 1.6;
            margin-bottom: 20px;
        }
        .tutorial-highlight {
            color: #ffea00;
            font-weight: 700;
        }
        .tutorial-nav {
            display: flex;
            justify-content: center;
            align-items: center;
        }
        .tutorial-btn {
            padding: 10px 24px;
            font-family: 'Orbitron', sans-serif;
            font-size: 0.7rem;
            font-weight: 700;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .tutorial-btn-skip {
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.3);
            color: #aaa;
        }
        .tutorial-btn-skip:hover {
            background: rgba(255, 255, 255, 0.2);
            color: #fff;
        }
        .tutorial-dots {
            display: flex;
            gap: 8px;
            justify-content: center;
            margin-top: 16px;
        }
        .tutorial-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.2);
            transition: background 0.3s ease;
        }
        .tutorial-dot.active {
            background: #ff00ff;
            box-shadow: 0 0 8px rgba(255, 0, 255, 0.5);
        }
        

        /* === BOTTOM NAVIGATION BAR === */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            background: linear-gradient(180deg, rgba(10, 10, 25, 0.95) 0%, rgba(5, 5, 15, 0.98) 100%);
            border-top: 1px solid rgba(255, 0, 255, 0.3);
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 8px 0;
            padding-bottom: max(8px, env(safe-area-inset-bottom, 8px));
            z-index: 900;
            backdrop-filter: blur(10px);
        }
        .bottom-nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
            padding: 4px 8px;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s ease;
            min-width: 56px;
        }
        .bottom-nav-item:hover {
            background: rgba(255, 0, 255, 0.1);
        }
        .bottom-nav-item.active {
            background: rgba(255, 0, 255, 0.2);
        }
        .bottom-nav-icon {
            font-size: 1.2rem;
        }
        .bottom-nav-label {
            font-family: 'Orbitron', sans-serif;
            font-size: 0.45rem;
            color: #888;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .bottom-nav-item.active .bottom-nav-label {
            color: #ff00ff;
        }

        /* Add bottom padding to game container for nav bar */
        #container {
            margin-bottom: 120px;
        }

        /* Operations filter buttons */
        .op-filter-btn {
            padding: 4px 10px;
            font-family: 'Orbitron', sans-serif;
            font-size: 0.5rem;
            font-weight: 700;
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 4px;
            background: rgba(255, 255, 255, 0.05);
            color: #888;
            cursor: pointer;
            transition: all 0.15s ease;
            text-transform: uppercase;
        }
        .op-filter-btn:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #fff;
        }
        .op-filter-btn.active {
            background: rgba(255, 0, 255, 0.2);
            border-color: rgba(255, 0, 255, 0.5);
            color: #ff00ff;
        }

        /* Highlight for hashchain card when navigating from game history */
        .highlight-chain {
            border-color: #00ffcc !important;
            box-shadow: 0 0 20px rgba(0, 255, 204, 0.4) !important;
            background: rgba(0, 255, 204, 0.1) !important;
            transform: scale(1.02);
        }