ehsan-dashboards/dashboards/old_hermes/ai_odyssey_complete_demo.html

691 lines
44 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="fa" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AI Odyssey & Royal Match: Complete Edition</title>
<!-- Tailwind CSS -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- Lucide Icons -->
<script src="https://unpkg.com/lucide@latest"></script>
<!-- Canvas Confetti -->
<script src="https://cdn.jsdelivr.net/npm/canvas-confetti@1.6.0/dist/confetti.browser.min.js"></script>
<!-- Vazirmatn Font -->
<link href="https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css" rel="stylesheet" type="text/css" />
<script>
tailwind.config = {
darkMode: 'class',
theme: {
extend: {
fontFamily: {
sans: ['Vazirmatn', 'sans-serif'],
},
colors: {
royal: {
gold: '#F59E0B',
purple: '#7C3AED',
card: '#111827',
dark: '#0B0F19',
border: '#1F2937',
neon: '#06B6D4',
red: '#EF4444',
green: '#10B981'
}
}
}
}
}
</script>
<style>
body {
font-family: 'Vazirmatn', sans-serif;
background-color: #070B12;
color: #F3F4F6;
overflow-x: hidden;
}
.glow-neon { box-shadow: 0 0 25px rgba(6, 182, 212, 0.35); }
.glow-gold { box-shadow: 0 0 30px rgba(245, 158, 11, 0.45); }
.glow-purple { box-shadow: 0 0 30px rgba(124, 58, 237, 0.45); }
.glow-pink { box-shadow: 0 0 25px rgba(236, 72, 153, 0.45); }
.node-path-line {
stroke-dasharray: 8;
animation: dash 30s linear infinite;
}
@keyframes dash {
to { stroke-dashoffset: -1000; }
}
.heart-beat {
animation: heartPulse 1.5s infinite;
}
@keyframes heartPulse {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.15); }
}
.timer-warning {
animation: pulseWarn 1s infinite;
}
@keyframes pulseWarn {
0%, 100% { background-color: rgba(239, 68, 68, 0.2); }
50% { background-color: rgba(239, 68, 68, 0.45); }
}
</style>
</head>
<body class="min-h-screen flex flex-col justify-between selection:bg-purple-500 selection:text-white">
<!-- Top Master Navigation Bar -->
<header class="bg-royal-card/95 backdrop-blur border-b border-royal-border sticky top-0 z-50 px-4 py-2.5">
<div class="max-w-7xl mx-auto flex flex-wrap items-center justify-between gap-3">
<!-- Brand & Title -->
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-2xl bg-gradient-to-tr from-purple-600 via-brand-500 to-amber-400 flex items-center justify-center text-gray-950 font-black shadow-lg shadow-purple-900/40">
<i data-lucide="crown" class="w-6 h-6 text-white stroke-[2.5]"></i>
</div>
<div>
<div class="flex items-center gap-2">
<h1 class="text-base font-black text-white tracking-wide">AI Odyssey: Royal Match</h1>
<span class="text-[10px] bg-purple-900/80 text-purple-300 border border-purple-600/50 px-2 py-0.5 rounded-full font-bold">Enterprise 6-Week Quest</span>
</div>
<p class="text-[11px] text-gray-400">یادگیری ۱ ساعت در هفته با ساختار کندی‌کراش + اسکواد سازمانی</p>
</div>
</div>
<!-- Global 6-Hour Season Countdown Timer -->
<div class="flex items-center gap-2 bg-gradient-to-r from-red-950/80 via-gray-900 to-amber-950/80 border border-amber-500/40 px-3.5 py-1.5 rounded-2xl shadow-lg shadow-amber-500/10">
<div class="relative flex items-center justify-center">
<i data-lucide="clock" class="w-4 h-4 text-amber-400 animate-spin" style="animation-duration: 8s;"></i>
<span class="absolute -top-0.5 -right-0.5 w-2 h-2 rounded-full bg-red-500 animate-ping"></span>
</div>
<div class="text-right">
<div class="text-[9px] text-gray-300 font-bold flex items-center gap-1">
<span>زمان کل سیزن ۶ هفته‌ای:</span>
<span class="text-amber-400 font-black">۶ ساعت</span>
</div>
<div class="text-xs font-black text-amber-300 font-mono tracking-wider" id="globalCountdownTimer">
۰۵:۵۹:۵۹
</div>
</div>
</div>
<!-- Department Switcher -->
<div class="flex items-center gap-2 bg-royal-dark px-3 py-1.5 rounded-2xl border border-royal-border">
<i data-lucide="building-2" class="w-4 h-4 text-royal-neon"></i>
<span class="text-xs text-gray-400 font-medium">دپارتمان:</span>
<select id="deptSelector" onchange="changeDepartment(this.value)" class="bg-transparent text-xs font-bold text-white focus:outline-none cursor-pointer">
<option value="marketing" class="bg-gray-900 text-white">مارکتینگ و محتوا</option>
<option value="tech" class="bg-gray-900 text-white">فنی و مهندسی</option>
<option value="ops" class="bg-gray-900 text-white">عملیات و پشتیبانی</option>
<option value="finance" class="bg-gray-900 text-white">مالی و حقوقی</option>
<option value="hr" class="bg-gray-900 text-white">منابع انسانی</option>
</select>
</div>
<!-- Player Status & Lives Bar -->
<div class="flex items-center gap-3">
<!-- Hearts / Lives -->
<div class="flex items-center gap-1 bg-royal-dark px-2.5 py-1 rounded-2xl border border-red-500/30">
<i data-lucide="heart" class="w-4 h-4 text-red-500 fill-red-500 heart-beat"></i>
<span id="playerLives" class="text-xs font-black text-white">۵ / ۵</span>
<button onclick="requestLifeFromSquad()" class="text-[9px] text-red-400 hover:text-white bg-red-950 px-1 rounded ml-1" title="درخواست جان">+</button>
</div>
<!-- Stars -->
<div class="flex items-center gap-1 bg-royal-dark px-2.5 py-1 rounded-2xl border border-amber-500/30">
<i data-lucide="star" class="w-4 h-4 text-amber-400 fill-amber-400"></i>
<span id="playerStars" class="text-xs font-black text-amber-400">۴۲ ★</span>
</div>
<!-- XP -->
<div class="hidden sm:flex items-center gap-1 bg-royal-dark px-2.5 py-1 rounded-2xl border border-purple-500/30">
<i data-lucide="zap" class="w-4 h-4 text-purple-400 fill-purple-400"></i>
<span id="playerScoreDisplay" class="text-xs font-black text-purple-300">۱,۴۵۰ XP</span>
</div>
<!-- Avatar Profile -->
<div class="flex items-center gap-2 cursor-pointer bg-gray-900 p-1 pl-2.5 rounded-full border border-gray-700">
<img src="https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=100&auto=format&fit=crop&q=80" alt="Avatar" class="w-7 h-7 rounded-full border border-amber-400 object-cover">
<div class="text-right text-[11px] font-bold text-white leading-tight">سارا</div>
</div>
</div>
</div>
</header>
<!-- Main Game Workspace: Left Squad Feed + Center Big Saga Map -->
<main class="max-w-7xl mx-auto w-full p-4 grid grid-cols-1 lg:grid-cols-12 gap-5 my-auto">
<!-- Left Column: Squad Room & Mini-Game Arenas (4 Cols) -->
<div class="lg:col-span-4 flex flex-col gap-4 order-2 lg:order-1">
<!-- Squad Help Feed (Royal Match Collaboration) -->
<div class="bg-royal-card border border-royal-border rounded-3xl p-4 shadow-xl">
<div class="flex items-center justify-between pb-2.5 border-b border-gray-800 mb-3">
<div class="flex items-center gap-2">
<i data-lucide="shield" class="w-4 h-4 text-amber-400"></i>
<h3 class="text-xs font-black text-white">اسکواد دپارتمان مارکتینگ</h3>
</div>
<button onclick="requestLifeFromSquad()" class="text-[10px] bg-purple-600 hover:bg-purple-500 text-white font-bold px-2 py-0.5 rounded-lg transition">
درخواست جان +
</button>
</div>
<!-- Live Help Requests -->
<div class="space-y-2 mb-3">
<div class="bg-royal-dark/90 border border-gray-800 p-2 rounded-xl flex items-center justify-between">
<div class="flex items-center gap-2">
<div class="w-7 h-7 rounded-full bg-purple-900 text-[10px] font-bold text-white flex items-center justify-center">امیر</div>
<div>
<div class="text-[11px] font-bold text-white">امیررضا جان می‌خواد!</div>
<div class="text-[9px] text-gray-400">مرحله ۵ (اکسل)</div>
</div>
</div>
<button onclick="sendGiftToMate(this, 'heart')" class="bg-red-600/20 hover:bg-red-600 text-red-400 hover:text-white border border-red-500/40 text-[10px] font-bold px-2.5 py-1 rounded-lg transition flex items-center gap-1">
<i data-lucide="heart" class="w-3 h-3 fill-current"></i>
<span>ارسال جان (+۱۰ XP)</span>
</button>
</div>
<div class="bg-royal-dark/90 border border-gray-800 p-2 rounded-xl flex items-center justify-between">
<div class="flex items-center gap-2">
<div class="w-7 h-7 rounded-full bg-blue-900 text-[10px] font-bold text-white flex items-center justify-center">مریم</div>
<div>
<div class="text-[11px] font-bold text-white">مریم اسکیل می‌خواد</div>
<div class="text-[9px] text-gray-400">کارت "استخراج JSON"</div>
</div>
</div>
<button onclick="sendGiftToMate(this, 'skill')" class="bg-blue-600/20 hover:bg-blue-600 text-blue-400 hover:text-white border border-blue-500/40 text-[10px] font-bold px-2.5 py-1 rounded-lg transition flex items-center gap-1">
<i data-lucide="zap" class="w-3 h-3 fill-current"></i>
<span>ارسال اسکیل (+۲۵ XP)</span>
</button>
</div>
</div>
<!-- Squad Chest -->
<div class="bg-gray-950/70 p-2.5 rounded-xl border border-gray-800">
<div class="flex items-center justify-between text-[11px] mb-1">
<span class="font-bold text-amber-400 flex items-center gap-1"><i data-lucide="gift" class="w-3.5 h-3.5"></i> صندوق تیمی قبیله</span>
<span class="text-gray-300 font-bold">۲۴۰ / ۳۰۰ ★</span>
</div>
<div class="w-full bg-gray-800 h-2 rounded-full overflow-hidden">
<div class="bg-gradient-to-r from-amber-500 to-yellow-300 h-full w-[80%] rounded-full"></div>
</div>
</div>
</div>
<!-- 3 Side Mini-Game Arenas (Challenge Bounties) -->
<div class="bg-royal-card border border-royal-border rounded-3xl p-4 shadow-xl flex-1 flex flex-col justify-between">
<div>
<div class="flex items-center justify-between pb-2 border-b border-gray-800 mb-3">
<div class="flex items-center gap-1.5">
<i data-lucide="swords" class="w-4 h-4 text-red-400"></i>
<h3 class="text-xs font-black text-white">مینی‌گیم‌های چالشی بغل (Side Puzzles)</h3>
</div>
<span class="text-[9px] bg-red-950 text-red-300 border border-red-800 px-1.5 py-0.5 rounded font-bold">سرعتی ۲د</span>
</div>
<div class="space-y-2">
<!-- Mini Game 1 -->
<div onclick="launchMiniGame('token_match')" class="bg-royal-dark/90 hover:bg-blue-950/50 border border-blue-500/30 hover:border-blue-400 p-2.5 rounded-2xl cursor-pointer transition group">
<div class="flex items-center justify-between">
<div class="flex items-center gap-2">
<span class="p-1.5 bg-blue-900/50 text-blue-400 rounded-lg group-hover:scale-110 transition"><i data-lucide="grid" class="w-3.5 h-3.5"></i></span>
<div>
<div class="text-xs font-bold text-white">۱. جورچین پرامپت (Token Match)</div>
<div class="text-[10px] text-gray-400">چیدن ۳ بلاک هم‌نوع پرامپت</div>
</div>
</div>
<span class="text-[10px] text-amber-400 font-bold bg-amber-500/10 px-2 py-0.5 rounded-full">+۵۰ کوین</span>
</div>
</div>
<!-- Mini Game 2 -->
<div onclick="launchMiniGame('save_king')" class="bg-royal-dark/90 hover:bg-red-950/50 border border-red-500/30 hover:border-red-400 p-2.5 rounded-2xl cursor-pointer transition group animate-pulse">
<div class="flex items-center justify-between">
<div class="flex items-center gap-2">
<span class="p-1.5 bg-red-900/50 text-red-400 rounded-lg group-hover:scale-110 transition"><i data-lucide="flame" class="w-3.5 h-3.5"></i></span>
<div>
<div class="text-xs font-bold text-white">۲. نجات مدیر (Save The Boss)</div>
<div class="text-[10px] text-gray-400">اصلاح پرامپت در ۳۰ ثانیه</div>
</div>
</div>
<span class="text-[10px] text-red-400 font-bold bg-red-500/10 px-2 py-0.5 rounded-full">+۲ جان</span>
</div>
</div>
<!-- Mini Game 3 -->
<div onclick="launchMiniGame('cut_tokens')" class="bg-royal-dark/90 hover:bg-purple-950/50 border border-purple-500/30 hover:border-purple-400 p-2.5 rounded-2xl cursor-pointer transition group">
<div class="flex items-center justify-between">
<div class="flex items-center gap-2">
<span class="p-1.5 bg-purple-900/50 text-purple-400 rounded-lg group-hover:scale-110 transition"><i data-lucide="scissors" class="w-3.5 h-3.5"></i></span>
<div>
<div class="text-xs font-bold text-white">۳. برش کلمات زائد (Word Golf)</div>
<div class="text-[10px] text-gray-400">حذف سریع کلمات اضافی پرامپت</div>
</div>
</div>
<span class="text-[10px] text-purple-300 font-bold bg-purple-500/10 px-2 py-0.5 rounded-full">+۱ اسکیل</span>
</div>
</div>
</div>
</div>
<div class="mt-3 pt-2 border-t border-gray-800 text-[10px] text-gray-400 text-center">
حل مینی‌گیم‌ها به شما اسکیل‌های کمکی برای مراحل مپ اصلی می‌دهد.
</div>
</div>
</div>
<!-- Right Column: The Full-Size Beautiful Visual Saga Map (8 Cols) -->
<div class="lg:col-span-8 bg-royal-card border border-royal-border rounded-3xl p-6 relative overflow-hidden shadow-2xl flex flex-col items-center justify-between min-h-[660px] order-1 lg:order-2">
<!-- Map Grid & Ambient Background -->
<div class="absolute inset-0 bg-[radial-gradient(#1f2937_1px,transparent_1px)] [background-size:24px_24px] opacity-40"></div>
<!-- Header of Map -->
<div class="w-full flex items-center justify-between z-10">
<div class="flex items-center gap-2">
<span class="w-2.5 h-2.5 rounded-full bg-green-500 animate-pulse"></span>
<span class="text-xs font-black text-gray-200 uppercase tracking-wider">سیزن ۱: کهکشان اتوماسیون سازمانی</span>
</div>
<div class="text-xs text-amber-400 font-bold bg-amber-500/10 border border-amber-500/30 px-3 py-1 rounded-xl">
مجموع پیشرفت دپارتمان: ۶۵٪
</div>
</div>
<!-- Central Canvas with Connected SVG Path & Interactive Nodes -->
<div class="relative w-full max-w-xl h-[520px] flex items-center justify-center my-auto">
<svg class="absolute inset-0 w-full h-full pointer-events-none" viewBox="0 0 500 500" fill="none">
<!-- S-Curve Path connecting nodes exactly as in user reference -->
<path d="M 100 450 C 180 430, 320 440, 400 400 C 460 360, 420 300, 350 280 C 250 250, 100 240, 100 180 C 100 110, 250 90, 400 60"
stroke="url(#gradient-path-master)" stroke-width="6" stroke-linecap="round" class="node-path-line opacity-75"/>
<defs>
<linearGradient id="gradient-path-master" x1="0%" y1="100%" x2="100%" y2="0%">
<stop offset="0%" stop-color="#10B981" />
<stop offset="30%" stop-color="#06B6D4" />
<stop offset="70%" stop-color="#8B5CF6" />
<stop offset="100%" stop-color="#F59E0B" />
</linearGradient>
</defs>
</svg>
<!-- Node 0: Genesis Avatar (Completed) -->
<div onclick="openNodeModal(0)" class="absolute bottom-4 left-16 flex flex-col items-center cursor-pointer group z-20">
<div class="w-12 h-12 rounded-2xl bg-royal-green border-4 border-gray-900 flex items-center justify-center text-gray-950 font-black shadow-lg shadow-green-500/40 group-hover:scale-125 transition-all">
<i data-lucide="check" class="w-6 h-6 stroke-[3]"></i>
</div>
<span class="text-[11px] font-bold text-green-400 mt-1.5 bg-royal-dark/95 px-2 py-0.5 rounded-md border border-green-500/30">۰. ساخت آواتار</span>
<div class="flex text-amber-400 text-[10px] mt-0.5">★★★</div>
</div>
<!-- Node 1: Reverse Prompt (Completed) -->
<div onclick="openNodeModal(1)" class="absolute bottom-16 right-20 flex flex-col items-center cursor-pointer group z-20">
<div class="w-12 h-12 rounded-full bg-royal-neon border-4 border-gray-900 flex items-center justify-center text-gray-950 font-black shadow-lg shadow-cyan-500/40 group-hover:scale-125 transition-all">
<i data-lucide="check" class="w-6 h-6 stroke-[3]"></i>
</div>
<span class="text-[11px] font-bold text-cyan-300 mt-1.5 bg-royal-dark/95 px-2 py-0.5 rounded-md border border-cyan-500/30">۱. مهندسی معکوس</span>
<div class="flex text-amber-400 text-[10px] mt-0.5">★★★</div>
</div>
<!-- Node 2: Token Golf (Completed) -->
<div onclick="openNodeModal(2)" class="absolute bottom-36 right-36 flex flex-col items-center cursor-pointer group z-20">
<div class="w-12 h-12 rounded-full bg-royal-neon border-4 border-gray-900 flex items-center justify-center text-gray-950 font-black shadow-lg shadow-cyan-500/40 group-hover:scale-125 transition-all">
<i data-lucide="check" class="w-6 h-6 stroke-[3]"></i>
</div>
<span class="text-[11px] font-bold text-cyan-300 mt-1.5 bg-royal-dark/95 px-2 py-0.5 rounded-md border border-cyan-500/30">۲. دوئل توکن</span>
<div class="flex text-amber-400 text-[10px] mt-0.5">★★☆</div>
</div>
<!-- Side Node (Pink Square): Speed Dungeon (Active Mini-Game) -->
<div onclick="launchMiniGame('save_king')" class="absolute bottom-48 right-6 flex flex-col items-center cursor-pointer group z-20 animate-bounce">
<div class="w-11 h-11 rounded-2xl bg-gradient-to-tr from-pink-600 to-rose-400 border-2 border-white flex items-center justify-center text-white font-black shadow-lg shadow-pink-500/50 group-hover:scale-125 transition-all glow-pink">
<i data-lucide="timer" class="w-6 h-6"></i>
</div>
<span class="text-[10px] font-bold text-pink-300 mt-1 bg-gray-950 px-2 py-0.5 rounded border border-pink-500/40">دانجن سرعتی (۳د)</span>
</div>
<!-- Node 3: Current ACTIVE Stage (Dirty Data to JSON) -->
<div onclick="openNodeModal(3)" class="absolute bottom-52 left-28 flex flex-col items-center cursor-pointer group z-20">
<div class="relative">
<div class="absolute -inset-2 bg-purple-600 rounded-full blur animate-pulse"></div>
<div class="relative w-14 h-14 rounded-full bg-royal-purple border-4 border-white flex items-center justify-center text-white font-black shadow-2xl shadow-purple-600/70 group-hover:scale-125 transition-all glow-purple">
<i data-lucide="play" class="w-6 h-6 fill-white"></i>
</div>
</div>
<span class="text-xs font-black text-purple-300 mt-2 bg-purple-950 px-3 py-0.5 rounded-md border border-purple-500 glow-purple">۳. استخراج داده کثیف</span>
<span class="text-[10px] text-amber-300 font-bold mt-0.5">مرحله باز / در انتظار</span>
</div>
<!-- Node 4: Locked -->
<div onclick="openLockedAlert(4)" class="absolute top-52 left-20 flex flex-col items-center cursor-not-allowed group z-20 opacity-60">
<div class="w-11 h-11 rounded-full bg-gray-800 border-2 border-gray-600 flex items-center justify-center text-gray-400">
<i data-lucide="lock" class="w-5 h-5"></i>
</div>
<span class="text-[10px] font-medium text-gray-400 mt-1">۴. شبیه‌ساز مشتری</span>
</div>
<!-- Node 5: Locked -->
<div onclick="openLockedAlert(5)" class="absolute top-44 left-52 flex flex-col items-center cursor-not-allowed group z-20 opacity-60">
<div class="w-11 h-11 rounded-full bg-gray-800 border-2 border-gray-600 flex items-center justify-center text-gray-400">
<i data-lucide="lock" class="w-5 h-5"></i>
</div>
<span class="text-[10px] font-medium text-gray-400 mt-1">۵. فرمول اکسل جادویی</span>
</div>
<!-- Node 6: Locked -->
<div onclick="openLockedAlert(6)" class="absolute top-36 right-36 flex flex-col items-center cursor-not-allowed group z-20 opacity-60">
<div class="w-11 h-11 rounded-full bg-gray-800 border-2 border-gray-600 flex items-center justify-center text-gray-400">
<i data-lucide="lock" class="w-5 h-5"></i>
</div>
<span class="text-[10px] font-medium text-gray-400 mt-1">۶. فیلتر اسرار PII</span>
</div>
<!-- Node 10: Final Boss (Yellow Crown) -->
<div onclick="openLockedAlert(10)" class="absolute top-8 right-16 flex flex-col items-center cursor-pointer group z-20">
<div class="w-16 h-16 rounded-2xl bg-gradient-to-tr from-amber-600 to-yellow-400 border-4 border-yellow-200 flex items-center justify-center text-gray-950 font-black shadow-2xl shadow-yellow-500/50 group-hover:scale-110 transition-all glow-gold">
<i data-lucide="crown" class="w-8 h-8 stroke-[2.5]"></i>
</div>
<span class="text-xs font-black text-amber-400 mt-1.5 bg-gray-950 px-3 py-0.5 rounded-full border border-amber-500/50">۱۰. نبرد نهایی (Custom GPT)</span>
</div>
</div>
<!-- Bottom Map Footer Controls (Matches attached screenshot) -->
<div class="w-full flex items-center justify-between pt-4 border-t border-royal-border mt-auto">
<div class="text-xs text-gray-400 flex items-center gap-2">
<i data-lucide="info" class="w-4 h-4 text-royal-neon"></i>
برای افزایش رتبه دپارتمان، می‌توانید مراحل قبلی را برای گرفتن ۳ ستاره مجدداً بازی کنید.
</div>
<button onclick="openNodeModal(3)" class="bg-gradient-to-r from-purple-600 to-royal-neon hover:from-purple-500 hover:to-cyan-400 text-white font-bold text-xs px-5 py-2.5 rounded-xl shadow-lg shadow-purple-900/40 transition flex items-center gap-2">
<span>ورود به مرحله فعلی</span>
<i data-lucide="arrow-left" class="w-4 h-4"></i>
</button>
</div>
</div>
</main>
<!-- Modal 1: Core Challenge 3 Interactive Sandbox (Dirty Data to JSON) -->
<div id="challengeModal" class="fixed inset-0 bg-black/85 backdrop-blur-md z-50 hidden flex items-center justify-center p-4">
<div class="bg-royal-card border border-purple-500/50 rounded-3xl max-w-3xl w-full p-6 shadow-2xl relative max-h-[90vh] overflow-y-auto">
<button onclick="closeModal()" class="absolute top-5 left-5 text-gray-400 hover:text-white p-1 rounded-lg hover:bg-gray-800 transition">
<i data-lucide="x" class="w-6 h-6"></i>
</button>
<div class="flex items-center gap-3 mb-4">
<div class="w-10 h-10 rounded-xl bg-purple-600 flex items-center justify-center text-white">
<i data-lucide="cpu" class="w-6 h-6"></i>
</div>
<div>
<div class="flex items-center gap-2">
<h2 class="text-lg font-bold text-white">چالش ۳: استخراج ساختاریافته از داده‌های کثیف</h2>
<span class="text-xs bg-purple-900/60 text-purple-300 px-2 py-0.5 rounded border border-purple-500/40">تخمین: ۱۰ دقیقه</span>
</div>
<p class="text-xs text-gray-400">ماموریت: آموزش ساخت خروجی استاندارد JSON از پیام‌های آشفته پشتیبانی</p>
</div>
</div>
<div class="bg-cyan-950/30 border border-royal-neon/30 rounded-xl p-3 mb-4 flex items-start gap-2.5">
<i data-lucide="sparkles" class="w-5 h-5 text-royal-neon shrink-0 mt-0.5"></i>
<div class="text-xs text-cyan-200 leading-relaxed">
<strong class="font-bold">سناریوی دپارتمان:</strong> ۲۰ پیام آشفته از چت‌های کنسلی سفر به شما داده شده است. پرامپتی بنویسید که این پیام‌ها را به جدول استاندارد JSON با ستون‌های <code class="bg-black/50 px-1 py-0.5 rounded text-white">علت_کنسلی، شدت_نارضایتی(۱-۵)، نیاز_به_تماس</code> تبدیل کند.
</div>
</div>
<div class="mb-4">
<label class="block text-xs font-bold text-gray-300 mb-1">داده‌های کثیف ورودی (Raw Messy Input):</label>
<div class="bg-royal-dark border border-royal-border rounded-xl p-3 text-xs text-gray-300 font-mono text-left dir-ltr max-h-24 overflow-y-auto">
"1. راننده نیومد نیم ساعت معطل شدم کنسل کردم پولمم کم کردین!<br>
2. اقا اشتباهی دستم خورد لغو شد شرمنده<br>
3. ماشینش خراب شد خود راننده گفت لغو بزن منم زدم لطفا پیگیری کنید"
</div>
</div>
<div class="mb-4">
<div class="flex items-center justify-between mb-1">
<label class="text-xs font-bold text-white flex items-center gap-1.5">
<i data-lucide="terminal" class="w-4 h-4 text-purple-400"></i>
پرامپت شما برای هوش مصنوعی (Sandbox Prompt):
</label>
<span class="text-[11px] text-gray-400">مصرف تخمینی: ۲۸ توکن</span>
</div>
<textarea id="userPromptInput" rows="4" class="w-full bg-royal-dark border border-gray-700 rounded-xl p-3 text-xs text-white placeholder-gray-500 focus:border-purple-500 focus:outline-none transition leading-relaxed" placeholder="پرامپت خود را اینجا بنویسید..."></textarea>
</div>
<div id="aiJudgeResult" class="hidden bg-gray-900 border border-gray-700 rounded-2xl p-4 mb-4">
<div class="flex items-center justify-between mb-2">
<span class="text-xs font-bold text-green-400 flex items-center gap-1.5">
<i data-lucide="check-circle-2" class="w-4 h-4"></i>
ارزیابی داور هوش مصنوعی (LLM-as-a-Judge): پاس شد!
</span>
<div class="flex text-amber-400 text-sm">★★★</div>
</div>
<div class="grid grid-cols-3 gap-2 text-center text-xs mb-2">
<div class="bg-royal-dark p-2 rounded-lg border border-gray-800">
<div class="text-gray-400 text-[10px]">اعتبار سینتکس JSON</div>
<div class="text-green-400 font-bold mt-0.5">۱۰۰٪ Valid</div>
</div>
<div class="bg-royal-dark p-2 rounded-lg border border-gray-800">
<div class="text-gray-400 text-[10px]">دقت دسته‌بندی</div>
<div class="text-royal-neon font-bold mt-0.5">۹۶٪ Match</div>
</div>
<div class="bg-royal-dark p-2 rounded-lg border border-gray-800">
<div class="text-gray-400 text-[10px]">XP کسب شده</div>
<div class="text-amber-400 font-bold mt-0.5">+۱۵۰ XP</div>
</div>
</div>
</div>
<div class="flex items-center justify-between pt-2">
<button onclick="useSpellHelp()" class="text-xs text-purple-400 hover:text-purple-300 font-bold flex items-center gap-1">
<i data-lucide="wand" class="w-4 h-4"></i>
استفاده از راهنمای طلایی (Spell Assist)
</button>
<div class="flex items-center gap-2">
<button onclick="closeModal()" class="px-4 py-2 rounded-xl text-xs font-bold text-gray-400 hover:text-white hover:bg-gray-800 transition">انصراف</button>
<button id="submitPromptBtn" onclick="evaluatePrompt()" class="bg-gradient-to-r from-purple-600 to-royal-neon hover:from-purple-500 hover:to-cyan-400 text-white font-bold text-xs px-6 py-2.5 rounded-xl shadow-lg shadow-purple-900/50 transition flex items-center gap-2">
<span>ارسال و داوری پرامپت</span>
<i data-lucide="send" class="w-4 h-4"></i>
</button>
</div>
</div>
</div>
</div>
<!-- Modal 2: Side Mini-Game Puzzle Modal (Save The Boss - 30s Timer) -->
<div id="miniGameModal" class="fixed inset-0 bg-black/85 backdrop-blur-md z-50 hidden flex items-center justify-center p-4">
<div class="bg-royal-card border border-red-500/50 rounded-3xl max-w-2xl w-full p-6 shadow-2xl relative">
<button onclick="closeMiniGameModal()" class="absolute top-4 left-4 text-gray-400 hover:text-white p-1 rounded-lg hover:bg-gray-800 transition">
<i data-lucide="x" class="w-6 h-6"></i>
</button>
<div class="flex items-center justify-between pb-3 border-b border-gray-800 mb-4">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-xl bg-red-600 flex items-center justify-center text-white font-bold">
<i data-lucide="alert-triangle" class="w-6 h-6"></i>
</div>
<div>
<h2 class="text-base font-black text-white">مینی‌گیم چالشی: نجات مدیر از توهم AI</h2>
<span class="text-xs text-red-300">موقعیت اضطراری • زمان محدود</span>
</div>
</div>
<div class="flex items-center gap-1.5 bg-red-950/80 border border-red-600 px-3 py-1.5 rounded-2xl text-red-400 font-black text-xs timer-warning">
<i data-lucide="timer" class="w-4 h-4"></i>
<span id="countdownDisplay">۰۰:۳۰</span>
</div>
</div>
<div class="bg-gray-900/90 border border-gray-800 rounded-2xl p-3.5 mb-4 text-xs leading-relaxed text-gray-300">
<strong class="text-amber-400 font-bold block mb-1">سناریو:</strong>
مدیرعامل می‌خواهد گزارش فروش را در اسلاید هیئت مدیره بگذارد اما عدد توهمی است! ۳ تکه پازل پرامپت زیر را به ترتیب انتخاب کنید تا خروجی اصلاح شود:
</div>
<div class="space-y-2.5 mb-4" id="puzzleBlocksContainer">
<button onclick="selectPuzzleBlock(this, 1)" class="w-full bg-royal-dark hover:bg-blue-950/80 border border-gray-700 hover:border-blue-400 p-3 rounded-xl text-right text-xs font-bold text-white transition flex items-center justify-between">
<span>۱. پرامپت نقش: «تو حسابدار ارشد هستی و فقط به اعداد واقعی جدول استناد می‌کنی»</span>
<i data-lucide="plus-circle" class="w-4 h-4 text-gray-400"></i>
</button>
<button onclick="selectPuzzleBlock(this, 2)" class="w-full bg-royal-dark hover:bg-blue-950/80 border border-gray-700 hover:border-blue-400 p-3 rounded-xl text-right text-xs font-bold text-white transition flex items-center justify-between">
<span>۲. پرامپت فیلتر: «هرگونه حدس زدن یا ساخت عدد بدون منبع اکیداً ممنوع است»</span>
<i data-lucide="plus-circle" class="w-4 h-4 text-gray-400"></i>
</button>
<button onclick="selectPuzzleBlock(this, 3)" class="w-full bg-royal-dark hover:bg-blue-950/80 border border-gray-700 hover:border-blue-400 p-3 rounded-xl text-right text-xs font-bold text-white transition flex items-center justify-between">
<span>۳. فرمت خروجی: «خروجی را در قالب جدول ۲ ستونه با درصد رشد واقعی نمایش بده»</span>
<i data-lucide="plus-circle" class="w-4 h-4 text-gray-400"></i>
</button>
</div>
<div class="flex items-center justify-between pt-2">
<span class="text-xs text-gray-400">بلوک‌های انتخاب شده: <strong id="selectedBlockCount" class="text-white">۰ / ۳</strong></span>
<button onclick="submitMiniGamePuzzle()" class="bg-gradient-to-r from-green-600 to-emerald-500 hover:from-green-500 hover:to-emerald-400 text-white font-black text-xs px-6 py-2.5 rounded-xl shadow-lg shadow-green-900/50 transition flex items-center gap-2">
<span>ثبت حل پازل و نجات مدیر</span>
<i data-lucide="check" class="w-4 h-4"></i>
</button>
</div>
</div>
</div>
<!-- Footer -->
<footer class="bg-royal-card border-t border-royal-border py-2.5 px-4 text-center text-xs text-gray-500">
AI Odyssey & Royal Match Unified Architecture • ترکیب مپ بصری ۱۰ نودی، مینی‌گیم‌های جانبی، تایمر ۶ ساعته و اتاق همکاری قبیله
</footer>
<!-- Logic Script -->
<script>
lucide.createIcons();
let selectedBlocks = 0;
let timerInterval = null;
let timeLeft = 30;
// Global 6-Hour Countdown Timer (21,600s)
let globalSeconds = 21599;
function updateGlobalTimer() {
const h = Math.floor(globalSeconds / 3600);
const m = Math.floor((globalSeconds % 3600) / 60);
const s = globalSeconds % 60;
const hStr = h < 10 ? '۰' + h : h;
const mStr = m < 10 ? '۰' + m : m;
const sStr = s < 10 ? '۰' + s : s;
const el = document.getElementById('globalCountdownTimer');
if(el) el.innerText = `${hStr}:${mStr}:${sStr}`;
if(globalSeconds > 0) globalSeconds--;
}
setInterval(updateGlobalTimer, 1000);
updateGlobalTimer();
function changeDepartment(dept) {
confetti({ particleCount: 30, spread: 50, origin: { y: 0.1 } });
}
function openNodeModal(nodeId) {
document.getElementById('challengeModal').classList.remove('hidden');
document.getElementById('aiJudgeResult').classList.add('hidden');
document.getElementById('submitPromptBtn').innerHTML = `<span>ارسال و داوری پرامپت</span><i data-lucide="send" class="w-4 h-4"></i>`;
lucide.createIcons();
}
function openLockedAlert(nodeId) {
alert(`نود ${nodeId} قفل است!\nبرای باز شدن این مرحله، ابتدا باید مراحل قبلی را با حداقل ۱ ستاره پاس کنید.`);
}
function closeModal() {
document.getElementById('challengeModal').classList.add('hidden');
}
function useSpellHelp() {
document.getElementById('userPromptInput').value = "شما یک دستیار تحلیل داده در شرکت هستید. متن‌های ورودی را پردازش کرده و تنها یک آبجکت معتبر JSON با ساختار زیر تحویل دهید:\n{\n \"reason\": \"...\",\n \"rage_score\": 1-5,\n \"urgent_call\": true/false\n}";
}
function evaluatePrompt() {
const btn = document.getElementById('submitPromptBtn');
btn.innerHTML = `<span class="animate-spin">⏳</span> در حال ارزیابی داور هوش مصنوعی...`;
setTimeout(() => {
document.getElementById('aiJudgeResult').classList.remove('hidden');
btn.innerHTML = `<span>موفقیت‌آمیز! ثبت شد</span>`;
confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } });
document.getElementById('playerScoreDisplay').innerText = "۱,۶۰۰ XP";
}, 1200);
}
function launchMiniGame(gameType) {
document.getElementById('miniGameModal').classList.remove('hidden');
selectedBlocks = 0;
timeLeft = 30;
document.getElementById('selectedBlockCount').innerText = "۰ / ۳";
document.getElementById('countdownDisplay').innerText = "۰۰:۳۰";
const buttons = document.querySelectorAll('#puzzleBlocksContainer button');
buttons.forEach(b => {
b.classList.remove('border-green-500', 'bg-green-950/40');
b.classList.add('border-gray-700', 'bg-royal-dark');
});
if(timerInterval) clearInterval(timerInterval);
timerInterval = setInterval(() => {
timeLeft--;
const sec = timeLeft < 10 ? '۰' + timeLeft : timeLeft;
document.getElementById('countdownDisplay').innerText = `۰۰:${sec}`;
if(timeLeft <= 0) {
clearInterval(timerInterval);
alert("زمان به پایان رسید! می‌توانید از هم‌تیمی‌های قبیله درخواست جان کنید.");
closeMiniGameModal();
}
}, 1000);
}
function closeMiniGameModal() {
if(timerInterval) clearInterval(timerInterval);
document.getElementById('miniGameModal').classList.add('hidden');
}
function selectPuzzleBlock(btn, id) {
if(!btn.classList.contains('border-green-500')) {
btn.classList.remove('border-gray-700', 'bg-royal-dark');
btn.classList.add('border-green-500', 'bg-green-950/40');
selectedBlocks++;
} else {
btn.classList.remove('border-green-500', 'bg-green-950/40');
btn.classList.add('border-gray-700', 'bg-royal-dark');
selectedBlocks--;
}
document.getElementById('selectedBlockCount').innerText = `${selectedBlocks} / ۳`;
}
function submitMiniGamePuzzle() {
if(selectedBlocks === 3) {
clearInterval(timerInterval);
confetti({ particleCount: 120, spread: 80, origin: { y: 0.6 } });
alert("شاهکار! مدیرعامل نجات پیدا کرد!\nجایزه: ۱ ستاره طلایی + ۱ کارت اسکیل جدید دریافت شد.");
document.getElementById('playerStars').innerText = "۴۳ ★";
closeMiniGameModal();
} else {
alert("لطفاً هر ۳ بلوک ضروری پرامپت را برای تکمیل زنجیره انتخاب کنید!");
}
}
function sendGiftToMate(btn, type) {
btn.innerHTML = `<i data-lucide="check" class="w-3 h-3"></i> ارسال شد!`;
btn.classList.remove('hover:bg-red-600', 'hover:bg-blue-600');
btn.classList.add('bg-green-600/30', 'text-green-400', 'border-green-500');
btn.disabled = true;
lucide.createIcons();
confetti({ particleCount: 40, spread: 60, origin: { y: 0.4 } });
}
function requestLifeFromSquad() {
alert("درخواست جان برای هم‌تیمی‌های دپارتمان مارکتینگ ارسال شد!");
}
</script>
</body>
</html>