/* ========================================
   MOBILE RESPONSIVE FIXES
   ======================================== */

/* Prevent horizontal overflow */
body {
    overflow-x: hidden;
}

.container {
    max-width: 100%;
    overflow-x: hidden;
}

/* Hero Section Mobile Improvements */
@media (max-width: 991px) {
    #hero {
        padding: 70px 0 30px;
        /* Reduced padding to fit in viewport */
        height: 100vh;
        /* Exact viewport height, not minimum */
        max-height: 100vh;
        /* Prevent overflow */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #hero .container {
        padding-top: 0;
        padding-bottom: 0;
    }

    #hero .display-3 {
        font-size: 1.8rem;
        /* Slightly reduced */
        line-height: 1.2;
        word-wrap: break-word;
        margin-bottom: 12px;
    }

    #hero .lead {
        font-size: 0.95rem;
        line-height: 1.4;
        margin-bottom: 20px;
    }

    .hero-btns {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .hero-btns .btn {
        width: 100%;
        margin: 0 !important;
        padding: 11px 28px;
        font-size: 0.9rem;
    }
}

/* Tablet Adjustments */
@media (max-width: 767px) {
    #hero {
        padding: 55px 15px 18px !important;
    }

    #hero .display-3 {
        font-size: 1.4rem !important;
        margin-bottom: 6px !important;
    }

    #hero .lead {
        font-size: 0.8rem !important;
        margin-bottom: 12px !important;
    }

    .section-title {
        font-size: 2rem;
    }

    .py-100 {
        padding-top: 60px;
        padding-bottom: 60px;
    }
}

/* Small Mobile Devices */
@media (max-width: 575px) {
    #hero {
        padding: 50px 10px 15px !important;
    }

    #hero .display-3 {
        font-size: 1.3rem !important;
        line-height: 1.2 !important;
        margin-bottom: 5px !important;
    }

    #hero .lead {
        font-size: 0.75rem !important;
        margin-bottom: 10px !important;
        line-height: 1.3 !important;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .btn-lg {
        padding: 8px 20px !important;
        font-size: 0.8rem !important;
    }

    .hero-btns .btn {
        padding: 8px 20px !important;
        font-size: 0.8rem !important;
    }
}

/* Portfolio Section Mobile */
@media (max-width: 991px) {
    .portfolio-container {
        padding: 40px 0;
    }

    .portfolio-track.is-static {
        padding: 0 15px;
    }

    .portfolio-track.is-static .game-card {
        width: 100%;
        max-width: 380px;
        margin: 0 auto 30px;
    }
}

/* About Section Mobile */
@media (max-width: 991px) {
    .about-image {
        margin-bottom: 30px;
    }

    .stats-grid .col-4 {
        text-align: center;
        margin-bottom: 20px;
    }

    .stats-grid h3 {
        font-size: 1.75rem;
    }
}

/* Contact Section Mobile */
@media (max-width: 991px) {
    #contact {
        padding: 60px 0;
    }

    #contact h2 {
        font-size: 2rem;
    }

    .form-control {
        font-size: 16px;
        /* Prevents zoom on iOS */
    }
}

/* Footer Mobile */
@media (max-width: 767px) {
    footer {
        text-align: center;
    }

    .footer-links {
        text-align: center;
    }

    .footer-newsletter {
        margin-top: 20px;
    }
}

/* Text Overflow Prevention */
h1,
h2,
h3,
h4,
h5,
h6,
p {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Ensure buttons don't overflow */
.btn {
    max-width: 100%;
    white-space: normal;
}

/* Fix navbar on mobile */
@media (max-width: 991px) {
    .navbar {
        padding: 15px;
    }

    .navbar-collapse {
        margin-top: 15px;
    }

    .nav-link {
        padding: 10px 0;
    }
}