 :root {
            --gold: #eab308;
            --gold-dark: #a16207;
            --zinc-900: #18181b;
            --zinc-800: #27272a;
            --zinc-700: #3f3f46;
            --bg-dark: #070707;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        body {
            background-color: var(--bg-dark);
            color: white;
            overflow-x: hidden;
            height: 100vh;
        }

        /* Background Image & Overlay */
        .bg-container {
            position: fixed;
            inset: 0;
            z-index: -1;
            background-image: url('https://images.unsplash.com/photo-1596838132731-3301c3fd4317?q=80&w=2070&auto=format&fit=crop');
            background-size: cover;
            background-position: center;
            filter: grayscale(30%) brightness(30%);
        }

        .bg-overlay {
            position: fixed;
            inset: 0;
            z-index: -1;
            background: linear-gradient(to bottom, rgba(0,0,0,0.6), rgba(0,0,0,0.4), var(--bg-dark));
            pointer-events: none;
        }

        .app-container {
            max-width: 450px;
            margin: 0 auto;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            position: relative;
            z-index: 10;
        }

        /* Screens */
        .screen {
            display: none;
            flex-direction: column;
            flex: 1;
            padding: 20px;
        }

        .screen.active {
            display: flex;
        }

        /* Header */
        header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(10px);
            border-bottom: 1px solid rgba(234, 179, 8, 0.2);
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .balance-box {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .coin-icon {
            width: 35px;
            height: 35px;
            background: linear-gradient(135deg, var(--gold-dark), var(--gold));
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: black;
            box-shadow: 0 4px 10px rgba(161, 98, 7, 0.4);
            transform: rotate(-3deg);
        }

        .balance-info p:first-child {
            font-size: 8px;
            text-transform: uppercase;
            font-weight: 900;
            letter-spacing: 1px;
            color: #71717a;
        }

        .balance-info p:last-child {
            font-size: 18px;
            font-weight: bold;
            color: var(--gold);
        }

        .nav-buttons {
            display: flex;
            gap: 8px;
        }

        .nav-btn {
            width: 38px;
            height: 38px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 10px;
            color: #d4d4d8;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: 0.2s;
        }

        .nav-btn:active { transform: scale(0.9); }

        /* Splash Screen */
        #splash-screen {
            justify-content: center;
            align-items: center;
            text-align: center;
        }

        .splash-logo {
            width: 120px;
            height: 120px;
            background: linear-gradient(135deg, #27272a, #000);
            border: 4px solid rgba(234, 179, 8, 0.5);
            border-radius: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--gold);
            margin-bottom: 30px;
            box-shadow: 0 0 50px rgba(234, 179, 8, 0.2);
            transform: rotate(12deg);
        }

        h1.title {
            font-size: 45px;
            font-weight: 900;
            font-style: italic;
            background: linear-gradient(to bottom, #fefce8, var(--gold), #713f12);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            letter-spacing: -2px;
        }

        .loader-bar {
            width: 200px;
            height: 6px;
            background: #18181b;
            border-radius: 10px;
            margin-top: 40px;
            overflow: hidden;
            position: relative;
        }

        .loader-fill {
            height: 100%;
            background: var(--gold);
            width: 0%;
            animation: load 3s ease-in-out forwards;
        }

        @keyframes load { 0% { width: 0%; } 100% { width: 100%; } }

        /* Menu Screen */
        .menu-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            gap: 40px;
        }

        .menu-title { text-align: center; }
        .menu-title h2 { font-size: 50px; font-weight: 900; italic: true; line-height: 0.9; }

        .bet-card {
            width: 100%;
            background: linear-gradient(to bottom, rgba(39, 39, 42, 0.9), rgba(0,0,0,0.9));
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 25px;
            padding: 30px;
            backdrop-filter: blur(10px);
        }

        .bet-card p { text-align: center; font-size: 10px; font-weight: 900; color: #71717a; margin-bottom: 20px; letter-spacing: 2px; }

        .chip-grid {
            display: grid;
            grid-cols: repeat(4, 1fr);
            display: flex;
            gap: 10px;
            margin-bottom: 30px;
        }

        .chip {
            flex: 1;
            padding: 12px 0;
            background: rgba(39, 39, 42, 0.5);
            border: 1px solid rgba(255, 255, 255, 0.05);
            border-radius: 12px;
            font-weight: 900;
            color: #a1a1aa;
            cursor: pointer;
            transition: 0.2s;
        }

        .chip.selected {
            background: var(--gold);
            color: black;
            border-color: #fefce8;
            box-shadow: 0 0 15px rgba(234, 179, 8, 0.3);
            transform: scale(1.1);
        }

        .main-btn {
            width: 100%;
            padding: 20px;
            border-radius: 20px;
            background: linear-gradient(to bottom, #facc15, var(--gold), #a16207);
            border: none;
            color: black;
            font-size: 18px;
            font-weight: 900;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            box-shadow: 0 10px 30px rgba(161, 98, 7, 0.3);
            transition: 0.2s;
        }

        .main-btn:active { transform: scale(0.95); }

        /* Vault Grid */
        .game-stats {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            background: rgba(0, 0, 0, 0.7);
            padding: 15px 0;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            text-align: center;
        }

        .stat-item p:first-child { font-size: 9px; font-weight: 900; color: #71717a; text-transform: uppercase; }
        .stat-item p:last-child { font-size: 14px; font-weight: bold; }

        .vault-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 15px;
            margin: 40px auto;
            width: 100%;
            max-width: 320px;
        }

        /* Vault 3D CSS Enhanced */
        .vault-item {
            aspect-ratio: 1/1;
            perspective: 1000px;
            cursor: pointer;
        }

        .vault-item.big { grid-column: span 3; aspect-ratio: 3/1; }

        .vault-inner {
            width: 100%;
            height: 100%;
            position: relative;
            transform-style: preserve-3d;
            transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .vault-item.open .vault-inner {
            transform: rotateY(-160deg);
        }

        .vault-face {
            position: absolute;
            inset: 0;
            backface-visibility: hidden;
            border-radius: 15px;
            border: 4px solid #3f3f46;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        .vault-front {
            background: linear-gradient(135deg, #27272a, #000);
            z-index: 2;
            transition: border-color 0.3s;
        }

        .vault-item:hover .vault-front {
            border-color: var(--gold);
        }

        .vault-back {
            background: linear-gradient(135deg, #064e3b, #000);
            transform: rotateY(180deg);
            border-color: rgba(34, 197, 94, 0.5);
        }

        .vault-back.trap {
            background: linear-gradient(135deg, #7f1d1d, #000);
            border-color: #ef4444;
        }

        /* 3D Dial with Spokes */
        .dial {
            width: 70px;
            height: 70px;
            border-radius: 50%;
            border: 4px solid #52525b;
            background: linear-gradient(to top, #18181b, #3f3f46);
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            box-shadow: inset 0 2px 10px rgba(0,0,0,0.8);
        }

        .vault-item.big .dial { width: 80px; height: 80px; }

        .dial-spokes {
            position: absolute;
            width: 100%;
            height: 100%;
            transition: transform 1s;
        }

        .vault-item:hover .dial-spokes {
            transform: rotate(180deg);
        }

        .spoke {
            position: absolute;
            top: 50%;
            left: 0;
            width: 100%;
            height: 4px;
            background: #52525b;
            border-radius: 4px;
            transform: translateY(-50%);
        }

        .spoke:nth-child(2) { transform: translateY(-50%) rotate(90deg); }
        .spoke:nth-child(3) { transform: translateY(-50%) rotate(45deg); }
        .spoke:nth-child(4) { transform: translateY(-50%) rotate(-45deg); }

        .dial-knob {
            width: 25px;
            height: 25px;
            background: linear-gradient(135deg, var(--gold-dark), var(--gold));
            border-radius: 50%;
            z-index: 5;
            border: 1px solid rgba(0,0,0,0.4);
            box-shadow: 0 4px 10px rgba(0,0,0,0.5);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .dial-knob::after {
            content: '';
            width: 6px;
            height: 6px;
            background: rgba(0,0,0,0.2);
            border-radius: 50%;
        }

        /* Result & Ad Modal */
        .modal {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.95);
            backdrop-filter: blur(10px);
            z-index: 1000;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

        .modal-content {
            width: 100%;
            max-width: 350px;
            background: linear-gradient(to bottom, #18181b, #000);
            border: 1px solid rgba(234, 179, 8, 0.2);
            border-radius: 40px;
            padding: 40px;
            text-align: center;
            position: relative;
        }

        .result-icon {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            margin: 0 auto 20px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .win-theme { color: var(--gold); border: 2px solid var(--gold); background: rgba(234, 179, 8, 0.1); }
        .loss-theme { color: #ef4444; border: 2px solid #ef4444; background: rgba(239, 68, 68, 0.1); }

        .multiplier-bar {
            display: flex;
            gap: 5px;
            height: 8px;
            width: 100%;
            max-width: 300px;
            margin: 20px 0;
        }

        .m-segment { flex: 1; background: rgba(255, 255, 255, 0.05); border-radius: 10px; }
        .m-segment.active { background: var(--gold); box-shadow: 0 0 10px var(--gold); }

        /* History */
        .history-list {
            flex: 1;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 12px;
            padding-bottom: 20px;
        }

        .history-item {
            background: rgba(0, 0, 0, 0.6);
            border: 1px solid rgba(255, 255, 255, 0.05);
            padding: 15px;
            border-radius: 15px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .status-win { color: #22c55e; font-weight: bold; }
        .status-loss { color: #ef4444; font-weight: bold; }

        /* Ad Modal Styling */
        .ad-container {
            width: 100%;
            height: 200px;
            background: #000;
            border-radius: 15px;
            margin: 20px 0;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            border: 1px solid var(--zinc-700);
        }

        .ad-placeholder {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #52525b;
            font-size: 12px;
            text-transform: uppercase;
            font-weight: 900;
            text-align: center;
            padding: 20px;
        }

        .ad-timer-ring {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            border: 3px solid rgba(234, 179, 8, 0.1);
            border-top: 3px solid var(--gold);
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 15px;
            font-weight: bold;
            animation: spin 1s linear infinite;
        }

        @keyframes spin { 100% { transform: rotate(360deg); } }

        .timer-text { animation: none; transform: rotate(0deg); }