* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --dark-bg: #0f0f23;
    --card-bg: #1a1a2e;
    --text-primary: #ffffff;
    --text-secondary: #b8b8d1;
    --border-color: rgba(255, 255, 255, 0.1);
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #0a0a15;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: rgba(10, 10, 21, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
}

.logo {
    font-size: 26px;
    font-weight: 900;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-icon {
    font-size: 32px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.logo-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Uploaded Logo Styles */
.site-logo {
    max-height: 50px;
    width: auto;
    /* Maintains aspect ratio */
    max-width: 100%;
    /* Prevents overflow */
    object-fit: contain;
}

@media (max-width: 768px) {
    .site-logo {
        max-height: 40px;
        /* Smaller on mobile */
    }
}

.nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    position: relative;
    padding: 10px 18px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.nav-icon {
    font-size: 18px;
}

/* Header Search */
.header-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 20px;
}

.header-search-input {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    color: var(--text-primary);
    font-size: 14px;
    width: 250px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

.header-search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: #667eea;
    width: 300px;
}

.header-search-input::placeholder {
    color: var(--text-secondary);
}

.header-search-btn {
    background: var(--primary-gradient);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-search-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    flex-direction: column;
    gap: 5px;
}

.hamburger {
    width: 28px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active .hamburger:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active .hamburger:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999;
}

.mobile-menu-overlay.active {
    display: block;
}

/* Hero Section */
.hero {
    position: relative;
    padding: 120px 0;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(245, 87, 108, 0.15) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero-title {
    font-size: 64px;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 20px;
    animation: fadeInUp 0.8s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 0.4s both;
}

/* Buttons */
.btn {
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
}

.btn-large {
    padding: 18px 40px;
    font-size: 18px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
}

/* Sections */
.section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 42px;
    font-weight: 900;
    margin-bottom: 15px;
}

.section-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.game-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--border-color);
    position: relative;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border-color: rgba(102, 126, 234, 0.5);
}

.game-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 75%;
    overflow: hidden;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

.game-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.game-card:hover .game-thumbnail img {
    transform: scale(1.1);
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-card:hover .game-overlay {
    opacity: 1;
}

.play-button {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
}

.play-button:hover {
    transform: scale(1.1);
}

.play-icon {
    color: white;
    font-size: 24px;
    margin-left: 4px;
}

.featured-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--secondary-gradient);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.game-info {
    padding: 20px;
}

.game-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.game-category {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.game-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

.category-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 35px 25px;
    text-align: center;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--category-color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-card:hover::before {
    opacity: 0.1;
}

.category-card:hover {
    transform: translateY(-8px);
    border-color: var(--category-color);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.category-icon {
    font-size: 48px;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.category-name {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.category-description {
    font-size: 14px;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
}

/* Footer */
.footer {
    background: var(--dark-bg);
    position: relative;
    margin-top: 80px;
    overflow: hidden;
}

.footer-wave {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.footer-wave svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 80px;
}

.footer-wave svg path {
    fill: #0a0a15;
}

.footer {
    padding: 100px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 50px;
    margin-bottom: 50px;
}

.footer-about {
    max-width: 350px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.footer-logo-icon {
    font-size: 36px;
}

.footer-logo h3 {
    font-size: 24px;
    font-weight: 900;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.footer-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 25px;
}

.footer-social {
    display: flex;
    gap: 12px;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-link:hover {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.footer-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 20px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--text-primary);
    transform: translateX(5px);
}

.footer-bottom {
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.copyright {
    color: var(--text-secondary);
    font-size: 14px;
}

.footer-tagline {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .hero {
        padding: 80px 0;
    }

    .hero-title {
        font-size: 42px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .section-title {
        font-size: 32px;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .header-search {
        display: none;
    }

    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(26, 26, 46, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 80px 30px 30px;
        gap: 5px;
        transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        z-index: 1000;
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
    }

    .nav.active {
        right: 0;
    }

    .nav-link {
        width: 100%;
        padding: 15px 20px;
        justify-content: flex-start;
        border-radius: 12px;
    }

    .nav-icon {
        font-size: 22px;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-about {
        max-width: 100%;
    }

    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }

    .section {
        padding: 60px 0;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 32px;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .btn-large {
        padding: 14px 28px;
        font-size: 16px;
    }
}

/* Animations */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.game-card {
    animation: fadeInUp 0.6s ease both;
}

.game-card:nth-child(1) {
    animation-delay: 0.1s;
}

.game-card:nth-child(2) {
    animation-delay: 0.2s;
}

.game-card:nth-child(3) {
    animation-delay: 0.3s;
}

.game-card:nth-child(4) {
    animation-delay: 0.4s;
}

.game-card:nth-child(5) {
    animation-delay: 0.5s;
}

.game-card:nth-child(6) {
    animation-delay: 0.6s;
}

/* Loading State */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
/* Homepage Article Section */
.article-section {
    padding: 60px 0;
    border-top: 1px solid var(--border-color);
}

.article-content {
    max-width: 1000px;
    margin: 0 auto;
    color: var(--text-secondary);
    line-height: 1.8;
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
    color: var(--text-primary);
    margin-top: 30px;
    margin-bottom: 20px;
    font-weight: 700;
}

.article-content h1 { font-size: 2.2rem; }
.article-content h2 { font-size: 1.8rem; }
.article-content h3 { font-size: 1.5rem; }

.article-content h1:first-child,
.article-content h2:first-child {
    margin-top: 0;
}

.article-content p {
    margin-bottom: 20px;
    font-size: 1.05rem;
}

.article-content a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.article-content a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.article-content ul, 
.article-content ol {
    margin-bottom: 20px;
    padding-left: 25px;
}

.article-content li {
    margin-bottom: 10px;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 20px 0;
}

@media (max-width: 768px) {
    .article-content {
        padding: 25px;
    }
    
    .article-content h1 { font-size: 1.8rem; }
    .article-content h2 { font-size: 1.5rem; }
}

/* Deep Check Safety Fixes */
.article-content {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

.hero-title {
    word-break: break-word; /* Prevent long titles from overflowing */
}

img {
    max-width: 100%; /* Global safety for all images */
    height: auto;
}

/* --- DEEP CHECK & MOBILE OPTIMIZATIONS --- */

/* Prevent horizontal scroll issues globally */
body,
html {
    overflow-x: hidden;
}

.container {
    max-width: 100%;
    overflow-x: clip;
    /* Modern fix for container overflow */
}

/* Article Content Safety */
.article-content {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    /* Breaks long words/URLs */
    hyphens: auto;
}

/* Responsive Media in Articles */
.article-content img,
.article-content iframe,
.article-content video,
.article-content embed {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px;
}

/* Scrollable Tables on Mobile */
.article-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
    border-collapse: collapse;
}

/* Hero Title Safety */
.hero-title {
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

/* Ensure inputs in Admin don't overflow */
.form-control {
    max-width: 100%;
}
/* Developer Link - UMAIR ATTA JOYIA */
.developer-link {
    font-weight: 800;
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.developer-link:hover {
    transform: translateY(-2px);
    text-shadow: 0 4px 8px rgba(245, 87, 108, 0.4);
}
