Currently I am facing some difficulties playing as black when my opponent plays
In the midgame actually my position gets cramped. Is there some strong response to
1.g3? I actually want some good defense lines to counter
By far, the most aggressive and direct response to 1.g3 is prepare for king-side pawn storm with h7-h5-h4.
That doesn't mean you play 1...h5! I'm afraid there're too many setups for ...h5. You have to see what White do. A possibility is:
...Bf5, ...Qd7, ...0-0-0, ...h5, ...h4, ...hxg3, ...Bh3
Sorry, there's no way to cover all the possibilities. The idea is not castle king-side yourself as you know before even making your first move you have the g3 target to attack. Castle queenside, keep your rook on the h (or g) file and go!
... gets cramped
The castle-queenside line shouldn't give you a cramped position, but a dynamic double-edge position.
Many responses will be good against g3 - if you have problems against it - actually its indicator that you have problems with general chess principles, so just study chess, get some good book on middle-game strategy and don't think of g3 for now. g3 is very slow and has no real opening threat for black - it takes on middle-game understanding though.
Play purposefully... What does it mean? From a high-level point of view, white is giving up control of the center by playing on the flank - the best way to counter that is for you to play in the center. Pawn advances in the center and piece activity will get you there. For example, if white castles king side and starts pushing h-pawn, that will make g3 pawn weak: you can try to control the a7 - f1 dark diagonal to launch an attack.
If you like some attacking dynamic response, you could try to form a reverse Sicilian like system with 1...c5 and transpose to a Reverse Saemisch attack, if he doesn't do an early e4.
[title "Reverse Saemisch"] [fen "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"] 1. g3 c5 2. Bg2 d5 3. Nf3 Nc6 4. O-O e5 5. d3 f6
Though Black is a tempo short as opposed to the usual Saemisch attack, the position is still equal and White has to play extremely sharp.
You can try castling long (if White doesn't generate enough queenside counter play) and kingside pawn storm.