/* Mobile Touch and Interaction Fixes */

/* Enable touch interaction for buttons and interactive elements */
.btn, 
.connect-wallet-btn, 
.disconnect-wallet-btn,
.wallet-dropdown-toggle,
.mobile-menu-toggle {
    -webkit-touch-callout: auto;
    -webkit-user-select: auto;
    -khtml-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    user-select: auto;
    touch-action: manipulation;
    cursor: pointer;
}

/* Mobile Navigation Fixes */
@media (max-width: 768px) {
    /* Ensure mobile menu toggle is visible and clickable */
    .mobile-menu-toggle {
        display: block !important;
        position: relative;
        z-index: 1001;
        padding: 10px;
        background: none;
        border: none;
        cursor: pointer;
        width: 40px;
        height: 30px;
        outline: none;
    }
    
    /* Override original span styles for consistency */
    .mobile-menu-toggle span {
        display: block;
        position: absolute;
        height: 3px;
        width: 100%;
        background: var(--color-primary) !important;
        border-radius: 1px;
        opacity: 1;
        left: 0;
        transform: rotate(0deg);
        transition: .25s ease-in-out;
    }
    
    .mobile-menu-toggle span:nth-child(1) { 
        top: 0px; 
    }
    
    .mobile-menu-toggle span:nth-child(2) { 
        top: 9px; 
    }
    
    .mobile-menu-toggle span:nth-child(3) { 
        top: 18px; 
    }
    
    .mobile-menu-toggle.active span:nth-child(1) {
        top: 9px;
        transform: rotate(135deg);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
        left: -60px;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        top: 9px;
        transform: rotate(-135deg);
    }
    
    /* Hide desktop navigation links on mobile */
    .main-header .nav-links {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        z-index: 1000;
        transition: all 0.3s ease;
    }
    
    .main-header .nav-links.active {
        display: flex;
    }
    
    .main-header .nav-links a {
        font-size: 1.5rem;
        color: var(--color-text);
        text-decoration: none;
        padding: 1rem;
        border-radius: 8px;
        transition: all 0.3s ease;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .main-header .nav-links a:hover,
    .main-header .nav-links a.active {
        background: rgba(255, 255, 255, 0.1);
        color: var(--color-primary);
    }
    
    /* Mobile wallet button fixes */
    .nav-links .wallet-info {
        margin-top: 2rem;
    }
    
    .nav-links .wallet-info .btn {
        min-height: 44px;
        padding: 12px 24px;
        font-size: 1rem;
    }
    
    /* Game interface mobile adjustments */
    #game-interface {
        padding: 1rem;
        margin-top: 80px;
    }
    
    .summoning-chamber {
        flex-direction: column;
        gap: 2rem;
    }
    
    .summoning-controls {
        width: 100%;
        max-width: none;
    }
    
    .quantity-options {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 0.5rem;
    }
    
    .quantity-btn {
        min-height: 44px;
        font-size: 0.9rem;
    }
    
    /* P2E page mobile fixes */
    .p2e-container {
        padding: 1rem;
        margin-top: 80px;
    }
    
    .treasures-summary {
        padding: 20px;
    }
    
    .treasures-summary h2 {
        font-size: 1.8rem;
    }
    
    .total-treasures {
        font-size: 2rem;
    }
    
    .adventure-nfts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Wallet dropdown mobile fixes */
    .wallet-dropdown {
        position: fixed !important;
        top: 80px !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: none !important;
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .wallet-connected {
        position: relative;
    }
    
    /* Touch feedback */
    .btn:active,
    .connect-wallet-btn:active,
    .mobile-menu-toggle:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
}

/* General mobile improvements */
@media (max-width: 480px) {
    .container {
        width: 95%;
        padding: 0 10px;
    }
    
    .logo-text {
        font-size: 1rem !important;
    }
    
    .logo img {
        height: 35px !important;
        width: 35px !important;
    }
    
    .main-header {
        padding: 0.5rem 0;
    }
    
    .summoning-controls h2 {
        font-size: 1.5rem;
    }
    
    .quantity-selector h3 {
        font-size: 1.2rem;
    }
}