:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #12122a;
    --bg-card: #1a1a3e;
    --bg-card-hover: #222255;
    --accent-purple: #7c3aed;
    --accent-blue: #3b82f6;
    --accent-pink: #ec4899;
    --accent-green: #10b981;
    --accent-orange: #f59e0b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: rgba(255, 255, 255, 0.08);
    --glass: rgba(255, 255, 255, 0.03);
    --shadow-glow: 0 0 40px rgba(124, 58, 237, 0.15);
    --radius: 16px;
    --radius-sm: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.7;
}

.bg-effects {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--accent-purple);
    top: -150px;
    right: -100px;
    animation: float 15s ease-in-out infinite;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-blue);
    bottom: -100px;
    left: -100px;
    animation: float 18s ease-in-out infinite reverse;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: var(--accent-pink);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float 12s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(20px, 10px) scale(1.02); }
}

.header {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 60px 20px 20px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.logo-icon {
    font-size: 48px;
    animation: bounce 2s ease-in-out infinite;
}

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

.logo h1 {
    font-size: 48px;
    font-weight: 900;
    background: linear-gradient(135deg, #7c3aed, #3b82f6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

.tagline {
    color: var(--text-secondary);
    font-size: 18px;
    font-weight: 500;
}

.main {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px;
}

.search-container {
    margin-bottom: 40px;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 60px;
    padding: 6px 8px 6px 24px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-glow);
}

.search-box:focus-within {
    border-color: var(--accent-purple);
    box-shadow: 0 0 60px rgba(124, 58, 237, 0.25);
}

.search-icon {
    width: 24px;
    height: 24px;
    color: var(--text-muted);
    flex-shrink: 0;
}

#searchInput {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 18px;
    font-family: 'Tajawal', sans-serif;
    padding: 14px 16px;
    direction: rtl;
}

#searchInput::placeholder {
    color: var(--text-muted);
}

.search-btn {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    color: white;
    border: none;
    padding: 14px 36px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.search-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
}

.filters {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--accent-purple);
    color: var(--text-primary);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    border-color: transparent;
    color: white;
}

.results.hidden {
    display: none;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.results-header h2 {
    font-size: 24px;
    font-weight: 800;
}

.results-stats {
    display: flex;
    gap: 12px;
}

.link-legend {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 8px 14px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 12px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.legend-badge.direct {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border-color: rgba(16, 185, 129, 0.3);
}

.stat {
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
}

.stat.original {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.stat.cracked {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.site-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
}

.site-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.site-card.original::before {
    background: linear-gradient(90deg, var(--accent-green), var(--accent-blue));
}

.site-card.cracked::before {
    background: linear-gradient(90deg, var(--accent-orange), var(--accent-pink));
}

.site-card:hover {
    transform: translateY(-4px);
    border-color: rgba(124, 58, 237, 0.3);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.card-icon.original {
    background: rgba(16, 185, 129, 0.15);
}

.card-icon.cracked {
    background: rgba(245, 158, 11, 0.15);
}

.card-title {
    font-size: 18px;
    font-weight: 800;
}

.card-url {
    font-size: 12px;
    color: var(--text-muted);
    direction: ltr;
    text-align: right;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 14px;
    line-height: 1.6;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
}

.tag.original {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.tag.cracked {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-orange);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.tag.lang {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.tag.speed {
    background: rgba(236, 72, 153, 0.1);
    color: var(--accent-pink);
    border: 1px solid rgba(236, 72, 153, 0.2);
}

.card-arrow {
    position: absolute;
    bottom: 24px;
    left: 24px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--glass);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.card-arrow svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transform: scaleX(-1);
}

.site-card:hover .card-arrow {
    background: var(--accent-purple);
}

.site-card:hover .card-arrow svg {
    color: white;
}

.popular-section {
    margin-bottom: 50px;
}

.popular-section h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 20px;
}

.popular-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.popular-chip {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: 'Tajawal', sans-serif;
}

.popular-chip:hover {
    border-color: var(--accent-purple);
    color: var(--text-primary);
    background: var(--bg-card-hover);
    transform: scale(1.05);
}

.info-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 50px;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    transition: all 0.3s ease;
}

.info-card:hover {
    border-color: rgba(124, 58, 237, 0.3);
    transform: translateY(-4px);
}

.info-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 12px;
}

.info-card h3 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 8px;
}

.info-card p {
    color: var(--text-secondary);
    font-size: 14px;
}

.footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 30px 20px;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

.footer p {
    color: var(--text-muted);
    font-size: 14px;
}

.footer-note {
    font-size: 12px;
    margin-top: 6px;
    opacity: 0.6;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.game-result {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.game-result:hover {
    border-color: rgba(124, 58, 237, 0.3);
}

.game-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.game-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.game-name {
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #a78bfa, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.meta-chip {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 50px;
}

.game-sources {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.source-col {
    padding: 18px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}

.source-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 15px;
    margin-bottom: 14px;
}

.source-title.original {
    color: var(--accent-green);
}

.source-title.cracked {
    color: var(--accent-orange);
}

.source-title .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.source-title.original .dot {
    background: var(--accent-green);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.source-title.cracked .dot {
    background: var(--accent-orange);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.source-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: inherit;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.source-link.original {
    background: rgba(16, 185, 129, 0.05);
}

.source-link.cracked {
    background: rgba(245, 158, 11, 0.05);
}

.source-link:hover {
    transform: translateX(-4px);
    border-color: inherit;
}

.source-link.original:hover {
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.15);
}

.source-link.cracked:hover {
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15);
}

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

.source-name {
    flex: 1;
    font-weight: 700;
    font-size: 15px;
}

.source-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border: 1px solid var(--border);
    white-space: nowrap;
}

.source-badge.direct {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border-color: rgba(16, 185, 129, 0.3);
}

.source-link {
    position: relative;
}

.source-go {
    width: 16px;
    height: 16px;
    transform: scaleX(-1);
    opacity: 0.5;
}

.source-link:hover .source-go {
    opacity: 1;
}

.no-source {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
}

.fallback-note {
    background: var(--bg-card);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: var(--radius);
    padding: 20px 24px;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.fallback-note .emoji {
    font-size: 24px;
}

@media (max-width: 640px) {
    .game-sources {
        grid-template-columns: 1fr;
    }

    .game-name {
        font-size: 18px;
    }
}

.no-results .emoji {
    font-size: 48px;
    margin-bottom: 16px;
}

.no-results h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.no-results p {
    color: var(--text-secondary);
}

@media (max-width: 640px) {
    .logo h1 {
        font-size: 32px;
    }
    
    .logo-icon {
        font-size: 36px;
    }
    
    .search-box {
        flex-direction: column;
        border-radius: 20px;
        padding: 12px;
    }
    
    #searchInput {
        padding: 12px;
        text-align: center;
    }
    
    .search-btn {
        width: 100%;
        border-radius: 14px;
        padding: 14px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .header {
        padding: 40px 16px 16px;
    }
    
    .tagline {
        font-size: 15px;
    }
}
