/* ========================================
   OKMAYA REALMS - Mobile Optimization CSS
   ======================================== */

/* ========================================
   GLOBAL MOBILE OPTIMIZATIONS
   ======================================== */

/* Force box-sizing on all elements */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Prevent horizontal overflow globally */
html, body {
    overflow-x: hidden;
    width: 100vw;
    max-width: 100vw;
}

/* Ensure all containers respect viewport width */
.container, .container-fluid {
    max-width: 100%;
    overflow-x: hidden;
}

/* ========================================
   RESPONSIVE MEDIA ELEMENTS
   ======================================== */

/* Make all images responsive */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Make videos responsive */
video, iframe {
    max-width: 100%;
    height: auto;
}

/* Responsive embeds */
.embed-responsive {
    position: relative;
    display: block;
    width: 100%;
    height: 0;
    overflow: hidden;
}

.embed-responsive::before {
    content: "";
    display: block;
    padding-top: 56.25%; /* 16:9 aspect ratio */
}

.embed-responsive iframe,
.embed-responsive video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ========================================
   NAVIGATION MOBILE OPTIMIZATIONS
   ======================================== */

/* Mobile navigation improvements */
.navbar {
    overflow-x: hidden;
}

.navbar ul {
    flex-wrap: wrap;
    max-width: 100%;
}

.navbar li {
    flex-shrink: 0;
    max-width: 100%;
}

.navbar a {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Mobile menu container */
.navbar-mobile {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
}

.navbar-mobile ul {
    max-width: 100%;
    overflow-x: hidden;
}

/* ========================================
   HEADER MOBILE OPTIMIZATIONS
   ======================================== */

/* Header responsive improvements */
#header {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
}

#header .logo {
    max-width: 100%;
    overflow: hidden;
}

#header .logo img {
    max-width: 100%;
    height: auto;
}

/* ========================================
   HERO SECTION MOBILE OPTIMIZATIONS
   ======================================== */

/* Hero section responsive */
#hero {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
}

#hero .container {
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
    overflow-x: hidden;
}

#hero h1 {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

#hero h2 {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Hero image responsive */
.hero-img {
    max-width: 100%;
    overflow: hidden;
}

.hero-img img {
    max-width: 100%;
    height: auto;
}

/* ========================================
   GAME CONTAINER MOBILE OPTIMIZATIONS
   ======================================== */

/* Game container responsive */
#game-container {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* Phaser game responsive scaling */
#game-container canvas {
    max-width: 100%;
    height: auto;
}

/* ========================================
   BUTTONS MOBILE OPTIMIZATIONS
   ======================================== */

/* Button responsive improvements */
.btn {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Mobile-specific button sizing */
@media (max-width: 768px) {
    .btn {
        padding: 8px 16px;
        font-size: 14px;
        min-height: 44px; /* Touch-friendly */
    }
}

/* ========================================
   CARDS AND GLASS ELEMENTS
   ======================================== */

/* Glass cards responsive */
.glass-card {
    max-width: 100%;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ========================================
   GRID SYSTEMS MOBILE OPTIMIZATIONS
   ======================================== */

/* Grid responsive improvements */
.grid {
    max-width: 100%;
    overflow-x: hidden;
}

.grid > * {
    max-width: 100%;
    overflow: hidden;
}

/* ========================================
   FOOTER MOBILE OPTIMIZATIONS
   ======================================== */

/* Footer responsive */
footer {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
}

footer .container {
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
}

/* Footer social links */
footer .social-links {
    max-width: 100%;
    overflow-x: hidden;
}

footer .social-links a {
    flex-shrink: 0;
}

/* ========================================
   MOBILE-SPECIFIC BREAKPOINTS
   ======================================== */

/* Extra small devices (phones, 576px and down) */
@media (max-width: 575.98px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    #hero h1 {
        font-size: 24px;
        line-height: 1.2;
    }
    
    #hero h2 {
        font-size: 16px;
        line-height: 1.3;
    }
    
    .btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .glass-card {
        padding: 15px;
        margin-bottom: 15px;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    #hero h1 {
        font-size: 28px;
        line-height: 1.2;
    }
    
    #hero h2 {
        font-size: 18px;
        line-height: 1.3;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    #hero h1 {
        font-size: 36px;
        line-height: 1.2;
    }
    
    #hero h2 {
        font-size: 20px;
        line-height: 1.3;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Utility classes for mobile optimization */
.w-mobile-100 { width: 100% !important; }
.max-w-mobile-100 { max-width: 100% !important; }
.overflow-x-hidden { overflow-x: hidden !important; }
.word-break { word-wrap: break-word !important; overflow-wrap: break-word !important; }

/* Hide elements on mobile if needed */
@media (max-width: 767.98px) {
    .hide-mobile { display: none !important; }
}

/* Show elements only on mobile */
@media (min-width: 768px) {
    .show-mobile-only { display: none !important; }
}

@media (max-width: 767.98px) {
    .show-mobile-only { display: block !important; }
}

/* ========================================
   TOUCH-FRIENDLY IMPROVEMENTS
   ======================================== */

/* Touch-friendly interactive elements */
@media (max-width: 768px) {
    a, button, input, select, textarea {
        min-height: 44px;
        min-width: 44px;
    }
    
    .btn {
        min-height: 44px;
        padding: 12px 20px;
    }
    
    /* Improve touch targets */
    .navbar a {
        padding: 15px 10px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* Reduce animations on mobile for better performance */
@media (max-width: 768px) {
    *, *::before, *::after {
        animation-duration: 0.3s !important;
        transition-duration: 0.3s !important;
    }
    
    /* Disable complex animations */
    .particle-bg {
        display: none;
    }
}

/* ========================================
   FIXES FOR COMMON MOBILE ISSUES
   ======================================== */

/* Fix for iOS Safari viewport issues */
@supports (-webkit-touch-callout: none) {
    html, body {
        -webkit-overflow-scrolling: touch;
        -webkit-text-size-adjust: 100%;
    }
}

/* Fix for Android Chrome */
@supports (-webkit-appearance: none) {
    html, body {
        -webkit-text-size-adjust: 100%;
    }
}

/* Prevent zoom on input focus */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    select, textarea, input[type="text"], input[type="password"], 
    input[type="datetime"], input[type="datetime-local"], 
    input[type="date"], input[type="month"], input[type="time"], 
    input[type="week"], input[type="number"], input[type="email"], 
    input[type="url"], input[type="search"], input[type="tel"], 
    input[type="color"] {
        font-size: 16px !important;
    }
}

/* ========================================
   END OF MOBILE OPTIMIZATION CSS
   ======================================== */
