<?php 
include 'db.php'; 

// সাইট সেটিংস লোড করা
$settings = $conn->query("SELECT * FROM site_settings WHERE id=1")->fetch_assoc();

// মেইন সিকিউরিটি ফাইল ইনক্লুড (যাতে রাইট ক্লিক ব্লক থাকে)
if(file_exists('security.php')){
    require_once 'security.php'; 
    if(function_exists('get_complete_security')) echo get_complete_security();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>TAMIM 1280 | EMOTE CODE</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <style>
        body { background: #010409; color: white; font-family: 'Segoe UI', sans-serif; }
        .neon-border { border: 1px solid rgba(0, 210, 255, 0.1); background: #0d1117; }
        .input-box { background: #0d1117; border: 1px solid #1f2937; color: white; border-radius: 12px; padding: 12px; outline: none; width: 100%; transition: 0.3s; }
        .input-box:focus { border-color: #00d2ff; }
        #toast { visibility: hidden; min-width: 200px; background: <?php echo $settings['code_color']; ?>; color: black; text-align: center; border-radius: 50px; padding: 12px; position: fixed; z-index: 999; left: 50%; bottom: 30px; transform: translateX(-50%); font-weight: bold; opacity: 0; transition: 0.4s; box-shadow: 0 0 20px <?php echo $settings['code_color']; ?>; }
        #toast.show { visibility: visible; opacity: 1; bottom: 50px; }
        .step-active { display: block !important; } .step-hidden { display: none !important; }
        .emote-grid { display: grid; gap: 12px; width: 100%; grid-template-columns: repeat(<?php echo $settings['grid_mobile']; ?>, minmax(0, 1fr)); }
        @media (min-width: 768px) { .emote-grid { grid-template-columns: repeat(<?php echo $settings['grid_tablet']; ?>, minmax(0, 1fr)); gap: 16px; } }
        @media (min-width: 1024px) { .emote-grid { grid-template-columns: repeat(<?php echo $settings['grid_desktop']; ?>, minmax(0, 1fr)); gap: 20px; } }
    </style>
</head>
<body class="min-h-screen">
    <header class="p-4 border-b border-gray-800 sticky top-0 bg-[#010409]/90 backdrop-blur-md z-50 flex justify-between items-center px-6 lg:px-20">
        <h1 class="text-2xl font-black italic tracking-tighter text-cyan-500">TAMIM <span class="text-white">1280</span></h1>
        <button id="backBtn" onclick="location.reload()" class="step-hidden bg-red-600/20 text-red-500 px-4 py-1.5 rounded-full text-xs font-bold uppercase hover:bg-red-600 transition">
            <i class="fas fa-sync-alt mr-1"></i> Reset
        </button>
    </header>
    <div id="toast">CODE COPIED!</div>