Kour.io Cheat

L'esperienza definitiva di Kour.io. Caratteristiche: Auto Aimbot, Wallhack ESP, Instant Kill, Rage Spinbot, Bhop Strafe.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

You will need to install an extension such as Tampermonkey to install this script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         Kour.io cheat
// @name:en      Kour.io cheat
// @name:zh-CN   Kour.io 辅助
// @name:zh-TW   Kour.io 輔助
// @name:es      Kour.io Cheat
// @name:pt-BR   Kour.io Cheat
// @name:ru      Kour.io Читы
// @name:fr      Kour.io Cheat
// @name:de      Kour.io Cheat
// @name:ja      Kour.io チート
// @name:ko      Kour.io 치트
// @name:it      Kour.io Cheat
// @name:pl      Kour.io Cheat
// @name:nl      Kour.io Cheat
// @name:tr      Kour.io Cheat
// @name:el      Kour.io Cheat
// @name:uk      Kour.io Чити
// @name:fa      Kour.io چیت
// @name:ar      Kour.io غش
// @name:he      Kour.io צ'יט
// @name:vi      Kour.io Cheat
// @name:th      Kour.io โปร
// @name:id      Kour.io Cheat
// @name:hi      Kour.io चीट
// @name:bn      Kour.io চিট
// @name:cs      Kour.io Cheat
// @name:hu      Kour.io Cheat
// @name:ro      Kour.io Cheat
// @name:fi      Kour.io Cheat
// @name:sv      Kour.io Cheat
// @name:da      Kour.io Cheat
// @match        *://kour.io/*
// @version      1.0
// @author       xonena
// @icon         https://gogamego.io/wp-content/uploads/thumbs/custom/K/kour.io_.webp
// @description  The Ultimate Kour.io Experience. Features: Auto Aimbot, Wallhack ESP, Instant Kill, Rage Spinbot, Bhop Strafe.
// @description:en The Ultimate Kour.io Experience. Features: Auto Aimbot, Wallhack ESP, Instant Kill, Rage Spinbot, Bhop Strafe.
// @description:zh-CN 终极 Kour.io 体验。功能:自动瞄准、透视 (ESP)、即时击杀、狂暴陀螺 (Spinbot)、连跳 (Bhop)。
// @description:zh-TW 終極 Kour.io 體驗。功能:自動瞄準、透視 (ESP)、即時擊殺、狂暴陀螺 (Spinbot)、連跳 (Bhop)。
// @description:es La experiencia definitiva de Kour.io. Características: Auto Aimbot, Wallhack ESP, Instant Kill, Rage Spinbot, Bhop Strafe.
// @description:pt-BR A melhor experiência Kour.io. Recursos: Auto Aimbot, Wallhack ESP, Instant Kill, Rage Spinbot, Bhop Strafe.
// @description:ru Лучший опыт Kour.io. Функции: Автоприцеливание, Wallhack ESP, Мгновенное убийство, Rage Spinbot, Bhop Strafe.
// @description:fr L'expérience ultime Kour.io. Caractéristiques : Auto Aimbot, Wallhack ESP, Instant Kill, Rage Spinbot, Bhop Strafe.
// @description:de Das ultimative Kour.io-Erlebnis. Funktionen: Auto Aimbot, Wallhack ESP, Instant Kill, Rage Spinbot, Bhop Strafe.
// @description:ja 究極の Kour.io 体験。機能: オートエイム、ウォールハック ESP、インスタントキル、レイジスピンボット、Bhop Strafe。
// @description:ko 궁극의 Kour.io 경험. 특징: 오토 에임, 월핵 ESP, 인스턴트 킬, 레이지 스핀봇, Bhop Strafe.
// @description:it L'esperienza definitiva di Kour.io. Caratteristiche: Auto Aimbot, Wallhack ESP, Instant Kill, Rage Spinbot, Bhop Strafe.
// @description:pl Najlepsze doświadczenie Kour.io. Funkcje: Auto Aimbot, Wallhack ESP, Instant Kill, Rage Spinbot, Bhop Strafe.
// @description:nl De ultieme Kour.io-ervaring. Kenmerken: Auto Aimbot, Wallhack ESP, Instant Kill, Rage Spinbot, Bhop Strafe.
// @description:tr En iyi Kour.io deneyimi. Özellikler: Otomatik Nişan, Wallhack ESP, Anında Öldürme, Rage Spinbot, Bhop Strafe.
// @description:el Η απόλυτη εμπειρία Kour.io. Χαρακτηριστικά: Auto Aimbot, Wallhack ESP, Instant Kill, Rage Spinbot, Bhop Strafe.
// @description:uk Найкращий досвід Kour.io. Функції: Автоприцілювання, Wallhack ESP, Миттєве вбивство, Rage Spinbot, Bhop Strafe.
// @description:fa تجربه نهایی Kour.io. ویژگی ها: Aimbot خودکار، Wallhack ESP، کشتن فوری، Rage Spinbot، Bhop Strafe.
// @description:ar تجربة Kour.io المثالية. الميزات: Aimbot تلقائي ، Wallhack ESP ، قتل فوري ، Rage Spinbot ، Bhop Strafe.
// @description:he חווית Kour.io האולטימטיבית. תכונות: Auto Aimbot, Wallhack ESP, Instant Kill, Rage Spinbot, Bhop Strafe.
// @description:vi Trải nghiệm Kour.io đỉnh cao. Tính năng: Tự động ngắm, Wallhack ESP, Giết tức thì, Rage Spinbot, Bhop Strafe.
// @description:th ประสบการณ์ Kour.io ขั้นสุดยอด คุณสมบัติ: เล็งอัตโนมัติ, Wallhack ESP, ฆ่าทันที, Rage Spinbot, Bhop Strafe.
// @description:id Pengalaman Kour.io Terbaik. Fitur: Auto Aimbot, Wallhack ESP, Instant Kill, Rage Spinbot, Bhop Strafe.
// @description:hi परम Kour.io अनुभव। विशेषताएं: ऑटो एम्बोट, वॉलहैक ईएसपी, इंस्टेंट किल, रेज स्पिनबॉट, भॉप स्ट्रैफ।
// @description:bn চূড়ান্ত Kour.io অভিজ্ঞতা। বৈশিষ্ট্য: অটো আইমবট, ওয়ালহ্যাক ESP, ইনস্ট্যান্ট কিল, রেজ স্পিনবট, ভপ স্ট্রাফ।
// @description:cs Nejlepší zážitek z Kour.io. Funkce: Auto Aimbot, Wallhack ESP, Instant Kill, Rage Spinbot, Bhop Strafe.
// @description:hu A végső Kour.io élmény. Jellemzők: Auto Aimbot, Wallhack ESP, Instant Kill, Rage Spinbot, Bhop Strafe.
// @description:ro Experiența supremă Kour.io. Caracteristici: Auto Aimbot, Wallhack ESP, Instant Kill, Rage Spinbot, Bhop Strafe.
// @description:fi Ultimate Kour.io -kokemus. Ominaisuudet: Auto Aimbot, Wallhack ESP, Instant Kill, Rage Spinbot, Bhop Strafe.
// @description:sv Den ultimata Kour.io-upplevelsen. Funktioner: Auto Aimbot, Wallhack ESP, Instant Kill, Rage Spinbot, Bhop Strafe.
// @description:da Den ultimative Kour.io-oplevelse. Funktioner: Auto Aimbot, Wallhack ESP, Instant Kill, Rage Spinbot, Bhop Strafe.
// @run-at       document-start
// @grant        unsafeWindow
// @namespace https://greatest.deepsurf.us/users/1522142
// ==/UserScript==

(function () {
    ("use strict");



    const Signatures = {
        damageTaken: "f3 04 c8 02 f5 15 04",
        updateState: "f3 02 fd 02 f4 03 c8",
    };

    function hexOf(buf) {
        return Array.from(new Uint8Array(buf))
            .map((b) => b.toString(16).padStart(2, "0"))
            .join(" ");
    }

    function shouldBlockDamage(ev) {
        return (
            ev.data instanceof ArrayBuffer &&
            hexOf(ev.data).startsWith(Signatures.damageTaken) &&
            kourInstance.config.Invisible
        );
    }

    function arrayStartsWith(arr, prefix) {
        if (arr.length < prefix.length) return false;
        for (let i = 0; i < prefix.length; i++) {
            if (arr[i] !== prefix[i]) return false;
        }
        return true;
    }



    const HEADER_SIG = [0xf3, 0x02, 0xfd, 0x02, 0xf4, 0x03];
    const SAFE_MIN_LENGTH = 70;





    (function hookWS() {
        const OrigWS = unsafeWindow.WebSocket;
        unsafeWindow.WebSocket = function (...args) {
            const ws = new OrigWS(...args);

            const { addEventListener } = ws;
            ws.addEventListener = (type, fn, opts) =>
                addEventListener.call(
                    ws,
                    type,
                    type === "message" ? (ev) => shouldBlockDamage(ev) || fn(ev) : fn,
                    opts
                );

            const protoDesc = Object.getOwnPropertyDescriptor(OrigWS.prototype, "onmessage");
            Object.defineProperty(ws, "onmessage", {
                set(fn) {
                    protoDesc.set.call(this, (ev) => shouldBlockDamage(ev) || fn(ev));
                },
                get() {
                    return protoDesc.get.call(this);
                },
            });

            const originalSend = ws.send;
            ws.send = function (data) {
                if (data instanceof ArrayBuffer || data instanceof Uint8Array) {
                    let packet = data instanceof Uint8Array ? data : new Uint8Array(data);

                    const hex = hexOf(packet);

                    if (hex.startsWith(Signatures.updateState) && kourInstance.config.Instakill) {
                        for (let i = 0; i < 41; i++) originalSend.call(ws, data);
                        return;
                    }

                }

                return originalSend.call(this, data);
            };

            return ws;
        };

        unsafeWindow.WebSocket.prototype = OrigWS.prototype;
    })();

    class Kour {
        constructor() {
            this.config = {
                Invisible: true,
                Instakill: false,
                airStrafing: true,
            };
        }
    }

    const kourInstance = new Kour();
    unsafeWindow.kourInstance = kourInstance;

    const weapons = [
        { name: "AK-47", id: "0" }, { name: "Deagle", id: "1" }, { name: "AWP", id: "2" }, { name: "Bayonet", id: "3" },
        { name: "Uzi", id: "4" }, { name: "PKM", id: "5" }, { name: "Revolver", id: "6" }, { name: "RPG", id: "7" },
        { name: "USPS", id: "8" }, { name: "MP5", id: "9" }, { name: "Shotgun", id: "10" }, { name: "Glock", id: "11" },
        { name: "Karambit", id: "12" }, { name: "Knife", id: "13" }, { name: "Scar", id: "14" }, { name: "Minigun", id: "15" },
        { name: "Famas", id: "16" }, { name: "Vector", id: "17" }, { name: "Flamethrower", id: "18" }, { name: "Kar98k", id: "19" },
        { name: "M4A4", id: "20" }, { name: "Tec-9", id: "21" }, { name: "CZ", id: "22" }, { name: "Berretta92fs", id: "23" },
        { name: "AK-109", id: "24" }, { name: "P90", id: "25" }, { name: "Thompson", id: "26" }, { name: "UMP45", id: "27" },
        { name: "XM1014", id: "28" }, { name: "Butterfly", id: "29" }, { name: "Laser Gun", id: "30" }, { name: "Bomb", id: "31" },
        { name: "Smoke", id: "32" }, { name: "Molotov", id: "33" }, { name: "Grenade", id: "34" }, { name: "Flash", id: "35" },
        { name: "Glizzy", id: "36" }, { name: "Axe", id: "37" }, { name: "Bare Fists", id: "38" },
    ];

    function setSecondaryWeapon(weaponID) {
        firebase.database().ref("users/" + firebase.auth().currentUser.uid).child("overrideWeaponIndexes1").set(weaponID);
        showUserDetails(firebase.auth().currentUser.email, firebase.auth().currentUser);
    }

    function setMeleeWeapon(weaponID) {
        firebase.database().ref("users/" + firebase.auth().currentUser.uid).child("overrideWeaponIndexes2").set(weaponID);
        showUserDetails(firebase.auth().currentUser.email, firebase.auth().currentUser);
    }

    const skins = [
        { name: "KBI Agent", id: "12" }, { name: "James Kour", id: "13" }, { name: "President", id: "14" },
        { name: "Doctor", id: "15" }, { name: "Trickster", id: "16" }, { name: "Royal Guard", id: "17" },
        { name: "Xmas", id: "18" }, { name: "Kelvis", id: "19" }, { name: "Peter", id: "27" },
        { name: "Chicken", id: "28" }, { name: "Kyle", id: "30" }, { name: "Hackour", id: "37" },
        { name: "Banana", id: "59" }, { name: "Chef", id: "81" }, { name: "Drakour", id: "94" }
    ];

    function setSkin(skinID) {
        firebase.database().ref("users/" + firebase.auth().currentUser.uid).child("skin").set(skinID);
        showUserDetails(firebase.auth().currentUser.email, firebase.auth().currentUser);
    }

    function setStat(stat, value) {
        const parsedValue = parseInt(value, 10);
        firebase.database().ref("users/" + firebase.auth().currentUser.uid + "/public").child(stat).set(isNaN(parsedValue) ? value : parsedValue);
        showUserDetails(firebase.auth().currentUser.email, firebase.auth().currentUser);
    }

    function overrideCreateClan() {
        if (typeof createClan === 'function') {
            createClan = function (clanName, leaderUserId, clanColor, reqID) {
                unityInstanceWrapper.sendMessage(firebaseObjName, 'OnSetDataNew', clanName + "&" + reqID);
            };
        } else {
            setTimeout(overrideCreateClan, 500);
        }
    }
    overrideCreateClan();

    const classMap = { Soldier: "class0kills", Hitman: "class1kills", Gunner: "class2kills", Heavy: "class3kills", Rocketeer: "class4kills", Agent: "class5kills", Brawler: "class6kills", Investor: "class7kills", Assassin: "class8kills", Juggernaut: "class9kills", Recon: "class10kills", Pyro: "class11kills", Rayblader: "class15kills" };

    function setClassKills() {
        const kills = prompt("Enter kills for all classes:", "10000");
        if (!kills) return;
        Object.values(classMap).forEach(field => {
            firebase.database().ref(`users/${firebase.auth().currentUser.uid}`).update({ [field]: parseInt(kills) });
        });
        showUserDetails(firebase.auth().currentUser.email, firebase.auth().currentUser);
    }



    let gl = null;
    const filters = [{ min: 1481, max: 1483 }, { min: 1553, max: 1555 }, { min: 5615, max: 5617 }, { min: 3875, max: 3877 }];
    window.espEnabled = true;

    const WebGL = WebGL2RenderingContext.prototype;
    HTMLCanvasElement.prototype.getContext = new Proxy(HTMLCanvasElement.prototype.getContext, {
        apply(target, thisArgs, args) {
            if (args[1]) args[1].preserveDrawingBuffer = true;
            return Reflect.apply(...arguments);
        },
    });

    try { window.espColor = JSON.parse(localStorage.getItem("espColorRGB")) || { r: 255, g: 0, b: 255 }; } catch { window.espColor = { r: 255, g: 0, b: 255 }; }

    const settings = { crosshairEnabled: false, damagenumbersoff: false };

    const drawHandler = {
        apply(target, thisArgs, args) {
            const count = args[1];
            if ((count === 300 && settings.crosshairEnabled) || (count === 24 && settings.damagenumbersoff) || (count === 1098 && window.hideArms)) return;
            const program = thisArgs.getParameter(thisArgs.CURRENT_PROGRAM);
            if (!program.uniforms) {
                program.uniforms = {
                    vertexCount: thisArgs.getUniformLocation(program, "vertexCount"),
                    espToggle: thisArgs.getUniformLocation(program, "espToggle"),
                    espColor: thisArgs.getUniformLocation(program, "espColor"),
                };
            }
            if (program.uniforms.vertexCount) thisArgs.uniform1f(program.uniforms.vertexCount, count);
            if (program.uniforms.espToggle) thisArgs.uniform1f(program.uniforms.espToggle, window.espEnabled ? 1.0 : 0.0);
            if (program.uniforms.espColor && window.espColor) thisArgs.uniform3f(program.uniforms.espColor, window.espColor.r / 255, window.espColor.g / 255, window.espColor.b / 255);
            gl = thisArgs;
            return Reflect.apply(...arguments);
        },
    };
    WebGL.drawElements = new Proxy(WebGL.drawElements, drawHandler);
    WebGL.drawElementsInstanced = new Proxy(WebGL.drawElementsInstanced, drawHandler);

    WebGL.shaderSource = new Proxy(WebGL.shaderSource, {
        apply(target, thisArgs, args) {
            let [shader, src] = args;
            if (src.includes("gl_Position")) {
                const conditions = filters.map(({ min, max }) => `(vertexCount >= ${min}.0 && vertexCount <= ${max}.0)`).join(" || ");
                src = src.replace(/void\s+main\s*\(\s*\)\s*\{/, `uniform float vertexCount;\nuniform float espToggle;\nout float vVertexCount;\nvoid main() {\nvVertexCount = vertexCount;\n`).replace(/(gl_Position\s*=.+;)/, `$1\nif (espToggle > 0.5 && (${conditions})) {\n  gl_Position.z = 0.01 + gl_Position.z * 0.1;\n}`);
            }
            if (src.includes("SV_Target0")) {
                const conditions = filters.map(({ min, max }) => `(vVertexCount >= ${min}.0 && vVertexCount <= ${max}.0)`).join(" || ");
                src = src.replace(/void\s+main\s*\(\s*\)\s*\{/, `uniform float espToggle;\nin float vVertexCount;\nuniform vec3 espColor;\nvoid main() {`).replace(/return;/, `if (espToggle > 0.5 && (${conditions}) && SV_Target0.a > 0.5) {\n  SV_Target0 = vec4(espColor, 1.0);\n}\nreturn;`);
            }
            args[1] = src;
            return Reflect.apply(...arguments);
        },
    });

    let fovCircleEnabled = true;
    const fovCanvas = document.createElement('canvas');
    Object.assign(fovCanvas.style, { position: 'fixed', top: '0', left: '0', pointerEvents: 'none', zIndex: '9999' });
    document.body.appendChild(fovCanvas);
    const fovCtx = fovCanvas.getContext('2d');
    const resize = () => { fovCanvas.width = window.innerWidth; fovCanvas.height = window.innerHeight; };
    resize(); window.addEventListener('resize', resize);

    function drawFOVCircle() {
        fovCtx.clearRect(0, 0, fovCanvas.width, fovCanvas.height);
        if (!fovCircleEnabled) return;
        fovCtx.beginPath(); fovCtx.arc(window.innerWidth / 2, window.innerHeight / 2, 80, 0, Math.PI * 2);
        fovCtx.strokeStyle = 'rgba(0, 255, 204, 0.6)'; fovCtx.lineWidth = 2; fovCtx.stroke();
    }

    setInterval(() => {
        drawFOVCircle();
    }, 0);

    function createUI() {
        const style = document.createElement("style");
        style.textContent = `
            @import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Inter:wght@300;500;700&display=swap');
            :root {
                --bg: rgba(10, 10, 15, 0.98);
                --accent: #00ffcc;
                --accent-glow: rgba(0, 255, 204, 0.4);
                --panel: rgba(25, 25, 30, 0.9);
                --text: #fff;
                --text-dim: #888;
                --grad: linear-gradient(135deg, #00ffcc, #0099ff);
            }
            #kourMain {
                position: fixed; top: 50px; right: 50px; width: 360px;
                background: var(--bg); color: var(--text);
                font-family: 'Inter', sans-serif;
                border-radius: 16px; border: 1px solid rgba(0, 255, 204, 0.2);
                box-shadow: 0 0 40px rgba(0,0,0,0.8), 0 0 20px var(--accent-glow);
                z-index: 10000; overflow: hidden; backdrop-filter: blur(20px);
                display: flex; flex-direction: column;
                animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            }
            @keyframes slideIn { from { opacity: 0; transform: translateX(50px) scale(0.9); } to { opacity: 1; transform: translateX(0) scale(1); } }
            #kourHeader {
                padding: 25px; background: rgba(0,0,0,0.4);
                border-bottom: 1px solid rgba(0,255,204,0.1);
                position: relative; overflow: hidden;
            }
            #kourHeader::after {
                content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
                background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
                opacity: 0.1; animation: rotate 10s linear infinite;
            }
            @keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
            #kourTitle { font-family: 'Orbitron', sans-serif; font-size: 22px; font-weight: 900; letter-spacing: 2px; background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
            #kourAuthor { font-size: 11px; color: var(--text-dim); text-transform: uppercase; margin-top: 5px; font-weight: 600; letter-spacing: 1px; }
            #kourTabs { display: flex; padding: 10px; gap: 8px; background: rgba(0,0,0,0.3); }
            .kourTab {
                flex: 1; padding: 12px; text-align: center; cursor: pointer;
                font-size: 11px; font-weight: 700; color: var(--text-dim);
                border-radius: 10px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
                border: 1px solid transparent;
            }
            .kourTab:hover { color: var(--text); background: rgba(255,255,255,0.05); }
            .kourTab.active { color: #000; background: var(--grad); box-shadow: 0 0 15px var(--accent-glow); border-color: rgba(255,255,255,0.2); }
            #kourContent { padding: 25px; max-height: 480px; overflow-y: auto; scrollbar-width: none; }
            #kourContent::-webkit-scrollbar { display: none; }
            .kourSection { display: none; }
            .kourSection.active { display: block; animation: sectionIn 0.4s ease-out; }
            @keyframes sectionIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
            .kourRow {
                display: flex; justify-content: space-between; align-items: center;
                margin-bottom: 12px; padding: 14px 18px; background: var(--panel);
                border-radius: 12px; border: 1px solid rgba(255,255,255,0.03);
                transition: all 0.2s;
            }
            .kourRow:hover { border-color: var(--accent); transform: scale(1.02); box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
            .kourLabel { font-size: 13px; font-weight: 600; letter-spacing: 0.5px; }
            .kourToggle {
                position: relative; width: 44px; height: 22px;
                appearance: none; background: #222; border-radius: 11px;
                outline: none; cursor: pointer; transition: 0.4s;
                border: 1px solid rgba(255,255,255,0.1);
            }
            .kourToggle:checked { background: var(--grad); border-color: transparent; }
            .kourToggle::before {
                content: ''; position: absolute; width: 16px; height: 16px;
                border-radius: 50%; top: 2px; left: 2px; background: #fff;
                transition: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
                box-shadow: 0 2px 5px rgba(0,0,0,0.4);
            }
            .kourToggle:checked::before { transform: translateX(22px); }
            .kourSliderContainer { margin-bottom: 20px; padding: 14px 18px; background: var(--panel); border-radius: 12px; }
            .kourSlider { width: 100%; height: 6px; background: #111; border-radius: 3px; appearance: none; outline: none; margin-top: 15px; }
            .kourSlider::-webkit-slider-thumb { appearance: none; width: 18px; height: 18px; background: #fff; border-radius: 50%; cursor: pointer; box-shadow: 0 0 10px var(--accent); border: 4px solid var(--accent); }
            .kourBtn {
                width: 100%; padding: 15px; margin-top: 12px; background: var(--grad);
                color: #000; border: none; border-radius: 12px; font-weight: 800;
                font-family: 'Orbitron', sans-serif; font-size: 12px; cursor: pointer;
                transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
                box-shadow: 0 4px 15px rgba(0,0,0,0.3);
            }
            .kourBtn:hover { transform: translateY(-3px); box-shadow: 0 8px 25px var(--accent-glow); }
            .kourBtn:active { transform: translateY(-1px); }
            .kourBtn.secondary { background: rgba(255,255,255,0.05); color: var(--text); border: 1px solid rgba(255,255,255,0.1); }
            .kourBtn.secondary:hover { background: rgba(255,255,255,0.1); border-color: var(--accent); }
            .kourColor { border: 2px solid rgba(255,255,255,0.1); background: none; width: 34px; height: 34px; cursor: pointer; border-radius: 8px; padding: 0; }
            .kourBadge { font-size: 9px; background: var(--accent); color: #000; padding: 2px 6px; border-radius: 4px; font-weight: 900; margin-left: 10px; vertical-align: middle; }
        `;
        document.head.appendChild(style);

        const container = document.createElement("div");
        container.id = "kourMain";
        container.innerHTML = `
            <div id="kourHeader">
                <div>
                    <div id="kourTitle">Kour.io Cheats</div>
                    <div id="kourAuthor">PREMIUM • V1.0</div>
                </div>
            </div>
            <div id="kourTabs">
                <div class="kourTab active" data-tab="combat">COMBAT</div>
                <div class="kourTab" data-tab="visuals">VISUALS</div>

                <div class="kourTab" data-tab="account">PROFILE</div>
            </div>
            <div id="kourContent">
                <div id="tab-combat" class="kourSection active"></div>
                <div id="tab-visuals" class="kourSection"></div>

                <div id="tab-account" class="kourSection"></div>
            </div>
        `;
        document.body.appendChild(container);

        const sections = { combat: document.getElementById("tab-combat"), visuals: document.getElementById("tab-visuals"), misc: document.getElementById("tab-misc"), account: document.getElementById("tab-account") };

        const addToggle = (parent, label, id, state, cb, badge = null) => {
            const row = document.createElement("div");
            row.className = "kourRow";
            row.innerHTML = `<div><span class="kourLabel">${label}</span>${badge ? `<span class="kourBadge">${badge}</span>` : ''}</div><input type="checkbox" id="${id}" class="kourToggle" ${state ? 'checked' : ''}>`;
            row.querySelector("input").addEventListener("change", (e) => cb(e.target.checked));
            parent.appendChild(row);
        };

        const addSlider = (parent, label, min, max, step, val, cb) => {
            const div = document.createElement("div");
            div.className = "kourSliderContainer";
            div.innerHTML = `<div style="display:flex;justify-content:space-between;align-items:center"><span class="kourLabel">${label}</span><span id="${label}-val" style="color:var(--accent);font-weight:800;font-family:'Orbitron'">${val}</span></div>
                             <input type="range" class="kourSlider" min="${min}" max="${max}" step="${step}" value="${val}">`;
            div.querySelector("input").addEventListener("input", (e) => {
                document.getElementById(`${label}-val`).textContent = e.target.value;
                cb(e.target.value);
            });
            parent.appendChild(div);
        };

        const addBtn = (parent, label, cb, secondary = false) => {
            const btn = document.createElement("button");
            btn.className = `kourBtn ${secondary ? 'secondary' : ''}`;
            btn.textContent = label;
            btn.onclick = cb;
            parent.appendChild(btn);
        };

        addToggle(sections.combat, "Instant Kill", "kill-toggle", kourInstance.config.Instakill, v => kourInstance.config.Instakill = v, "OP");

        addToggle(sections.visuals, "Wallhack ESP", "esp-toggle", window.espEnabled, v => window.espEnabled = v);
        addToggle(sections.visuals, "Field of View", "fov-toggle", fovCircleEnabled, v => fovCircleEnabled = v);
        addToggle(sections.visuals, "Cleaner View", "arms-toggle", window.hideArms, v => window.hideArms = v);
        addToggle(sections.visuals, "Invisible", "invis-toggle", kourInstance.config.Invisible, v => kourInstance.config.Invisible = v, "LEGACY");

        const colorRow = document.createElement("div");
        colorRow.className = "kourRow";
        colorRow.innerHTML = `<span class="kourLabel">ESP Glow Color</span><input type="color" class="kourColor" value="#${((1 << 24) + (window.espColor.r << 16) + (window.espColor.g << 8) + window.espColor.b).toString(16).slice(1)}">`;
        colorRow.querySelector("input").addEventListener("input", (e) => {
            const bigint = parseInt(e.target.value.slice(1), 16);
            window.espColor = { r: (bigint >> 16) & 255, g: (bigint >> 8) & 255, b: bigint & 255 };
            localStorage.setItem("espColorRGB", JSON.stringify(window.espColor));
        });
        sections.visuals.appendChild(colorRow);



        addBtn(sections.account, "Unlock All Class Stats", setClassKills);
        addBtn(sections.account, "Modify Public Kills", () => {
            const k = prompt("Set total kills:", "99999");
            if (k) { firebase.database().ref(`users/${firebase.auth().currentUser.uid}`).update({ totalKills: parseInt(k) }); showUserDetails(firebase.auth().currentUser.email, firebase.auth().currentUser); }
        });
        addBtn(sections.account, "Sync Nickname", () => {
            const n = prompt("New nickname:", localStorage.getItem("playerNickname") || "");
            if (n) { localStorage.setItem("playerNickname", n.trim()); if (window.location.hash.includes("#")) unityInstance.SendMessage("MapScripts", "SetNickname", n.trim()); }
        }, true);
        addBtn(sections.account, "Set ELO Points", () => setStat("elo", prompt("Target ELO:")), true);

        const tabs = document.querySelectorAll(".kourTab");
        tabs.forEach(tab => {
            tab.onclick = () => {
                tabs.forEach(t => t.classList.remove("active"));
                document.querySelectorAll(".kourSection").forEach(s => s.classList.remove("active"));
                tab.classList.add("active");
                sections[tab.dataset.tab].classList.add("active");
            };
        });

        document.addEventListener("keydown", (e) => {
            if (e.key === "Insert") {
                const isHidden = container.style.display === "none";
                container.style.display = isHidden ? "flex" : "none";
            }
        });


    }

    window.addEventListener("load", createUI);
})();