/* Mobile Game Card Enhancements - Targeted Fix for Mobile Readability */

/* Main mobile media query - targets all mobile devices */
@media (max-width: 768px) {
    
    /* Enhanced game card layout for mobile */
    .game-card {
        min-height: 420px !important;
        padding: 1rem !important;
        margin-bottom: 1rem !important;
        border-radius: 12px !important;
        font-size: 0.9rem !important;
        background: rgba(255, 255, 255, 0.1) !important;
        backdrop-filter: blur(10px) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
    }
    
    /* Game title styling */
    .game-title {
        font-size: 1.1rem !important;
        font-weight: 700 !important;
        margin-bottom: 0.75rem !important;
        line-height: 1.3 !important;
        color: #ffffff !important;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
    }
    
    /* Platform display */
    .game-platform {
        display: inline-block !important;
        padding: 0.4rem 0.8rem !important;
        background: rgba(102, 126, 234, 0.8) !important;
        color: white !important;
        border-radius: 20px !important;
        font-size: 0.75rem !important;
        font-weight: 600 !important;
        text-transform: uppercase !important;
        margin-bottom: 1rem !important;
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
    }
    
    /* Game details section */
    .game-details {
        margin: 1rem 0 !important;
        padding: 0.75rem !important;
        background: rgba(0, 0, 0, 0.3) !important;
        border-radius: 8px !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    
    .detail-item {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-bottom: 0.5rem !important;
        padding: 0.25rem 0 !important;
    }
    
    .detail-item:last-child {
        margin-bottom: 0 !important;
    }
    
    .detail-label {
        font-size: 0.8rem !important;
        color: rgba(255, 255, 255, 0.8) !important;
        font-weight: 500 !important;
    }
    
    .detail-value {
        font-size: 0.9rem !important;
        font-weight: 700 !important;
        color: #4ecca3 !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
    }
    
    /* Owned status styling */
    .owned-status {
        text-align: center !important;
        margin: 1rem 0 !important;
    }
    
    .owned-badge {
        display: inline-block !important;
        padding: 0.6rem 1.2rem !important;
        background: linear-gradient(45deg, #28a745, #20c997) !important;
        color: white !important;
        border-radius: 25px !important;
        font-weight: 700 !important;
        font-size: 0.85rem !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        box-shadow: 0 3px 10px rgba(40, 167, 69, 0.4) !important;
        border: 2px solid rgba(255, 255, 255, 0.3) !important;
    }
    
    /* Want level stars */
    .want-level {
        text-align: center !important;
        margin: 1rem 0 !important;
        padding: 0.5rem !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border-radius: 8px !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    
    .star {
        font-size: 1.4rem !important;
        margin: 0 2px !important;
        color: #ffd700 !important;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
        filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.5)) !important;
    }
    
    .star.empty {
        color: rgba(255, 255, 255, 0.2) !important;
        filter: none !important;
    }
    
    /* Enhanced mobile buttons */
    .game-actions {
        margin: 1.25rem 0 0.75rem 0 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .action-btn {
        width: 100% !important;
        padding: 0.8rem 1rem !important;
        border: none !important;
        border-radius: 8px !important;
        font-size: 0.85rem !important;
        font-weight: 600 !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        min-height: 48px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
    }
    
    .owned-btn {
        background: linear-gradient(45deg, #28a745, #20c997) !important;
        color: white !important;
    }
    
    .owned-btn:hover {
        background: linear-gradient(45deg, #1e7e34, #1aa085) !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4) !important;
    }
    
    .remove-owned-btn {
        background: linear-gradient(45deg, #dc3545, #c82333) !important;
        color: white !important;
    }
    
    .remove-owned-btn:hover {
        background: linear-gradient(45deg, #bd2130, #a02129) !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4) !important;
    }
    
    .ignore-btn {
        background: rgba(108, 117, 125, 0.8) !important;
        color: white !important;
    }
    
    .ignore-btn.ignored {
        background: linear-gradient(45deg, #6c757d, #5a6268) !important;
        color: #ffc107 !important;
    }
    
    .ignore-btn:hover {
        background: rgba(90, 98, 104, 0.9) !important;
        transform: translateY(-1px) !important;
    }
    
    /* Want level select dropdown */
    .want-select {
        width: 100% !important;
        padding: 0.8rem !important;
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
        border-radius: 8px !important;
        background: rgba(0, 0, 0, 0.5) !important;
        color: white !important;
        font-size: 0.85rem !important;
        font-weight: 600 !important;
        cursor: pointer !important;
        min-height: 48px !important;
        backdrop-filter: blur(5px) !important;
    }
    
    .want-select option {
        background: #2c3e50 !important;
        color: white !important;
        padding: 0.5rem !important;
    }
    
    /* Quick links section */
    .quick-links {
        display: flex !important;
        gap: 0.5rem !important;
        margin: 1rem 0 0.75rem 0 !important;
    }
    
    .link-btn {
        flex: 1 !important;
        padding: 0.7rem 0.5rem !important;
        text-decoration: none !important;
        border-radius: 8px !important;
        font-size: 0.8rem !important;
        font-weight: 600 !important;
        text-align: center !important;
        transition: all 0.2s ease !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        text-transform: uppercase !important;
        letter-spacing: 0.3px !important;
    }
    
    .ebay-btn {
        background: linear-gradient(45deg, #0066cc, #0052a3) !important;
        color: white !important;
    }
    
    .ebay-btn:hover {
        background: linear-gradient(45deg, #0052a3, #003d7a) !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 3px 10px rgba(0, 102, 204, 0.4) !important;
    }
    
    .cex-btn {
        background: linear-gradient(45deg, #ff6b35, #f7931e) !important;
        color: white !important;
    }
    
    .cex-btn:hover {
        background: linear-gradient(45deg, #e55a2b, #d4841f) !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 3px 10px rgba(255, 107, 53, 0.4) !important;
    }
    
    /* Game controls */
    .game-controls {
        margin-top: 0.75rem !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
        padding-top: 0.75rem !important;
    }
    
    .control-btn {
        width: 100% !important;
        padding: 0.6rem 1rem !important;
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
        border-radius: 6px !important;
        background: rgba(255, 255, 255, 0.1) !important;
        color: rgba(255, 255, 255, 0.9) !important;
        font-size: 0.8rem !important;
        font-weight: 500 !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        min-height: 42px !important;
        backdrop-filter: blur(5px) !important;
    }
    
    .control-btn:hover {
        background: rgba(255, 255, 255, 0.2) !important;
        color: white !important;
        transform: translateY(-1px) !important;
    }
    
    .edit-btn {
        background: rgba(102, 126, 234, 0.3) !important;
        border-color: rgba(102, 126, 234, 0.5) !important;
    }
    
    .edit-btn:hover {
        background: rgba(102, 126, 234, 0.5) !important;
        border-color: rgba(102, 126, 234, 0.7) !important;
    }
}

/* Very small mobile screens (phones in portrait) */
@media (max-width: 400px) {
    .game-card {
        padding: 0.75rem !important;
        min-height: 380px !important;
    }
    
    .game-title {
        font-size: 1rem !important;
    }
    
    .action-btn {
        padding: 0.7rem 0.8rem !important;
        font-size: 0.8rem !important;
    }
    
    .link-btn {
        padding: 0.6rem 0.4rem !important;
        font-size: 0.75rem !important;
    }
    
    .star {
        font-size: 1.2rem !important;
        margin: 0 1px !important;
    }
}

/* Landscape mobile (when width > height and under 768px) */
@media (orientation: landscape) and (max-width: 768px) and (max-height: 500px) {
    .game-card {
        min-height: 320px !important;
    }
    
    .game-actions {
        margin: 0.75rem 0 !important;
    }
    
    .action-btn {
        padding: 0.6rem 0.8rem !important;
        min-height: 42px !important;
    }
    
    .quick-links {
        margin: 0.75rem 0 !important;
    }
    
    .link-btn {
        padding: 0.5rem 0.4rem !important;
        min-height: 38px !important;
        font-size: 0.75rem !important;
    }
}

/* Platform-specific colors for mobile */
@media (max-width: 768px) {
    .platform-megadrive {
        background: rgba(52, 73, 94, 0.9) !important;
    }
    
    .platform-snes {
        background: rgba(142, 68, 173, 0.9) !important;
    }
    
    .platform-32x {
        background: rgba(230, 126, 34, 0.9) !important;
    }
    
    .platform-mega-cd {
        background: rgba(39, 174, 96, 0.9) !important;
    }
    
    .platform-master-system {
        background: rgba(192, 57, 43, 0.9) !important;
    }
}

/* Grid layout fixes for mobile */
@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
        padding: 0.5rem !important;
    }
}

@media (max-width: 500px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
}

/* Touch improvements */
@media (max-width: 768px) {
    .game-card {
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.2) !important;
        touch-action: manipulation !important;
    }
    
    .action-btn,
    .control-btn,
    .link-btn,
    .want-select {
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1) !important;
        touch-action: manipulation !important;
        -webkit-user-select: none !important;
        user-select: none !important;
    }
    
    /* Improve tap targets */
    .action-btn:active,
    .control-btn:active,
    .link-btn:active {
        transform: scale(0.98) !important;
        opacity: 0.8 !important;
    }
}
