Hard luck (or 'tough luck'). Using your example —
I heard that you lost. Hard luck!
To me, would sound much more casual than a longer sentence (e.g. "I'm sorry to hear that", etc.) From Cambridge Dictionary:
hard luck! (British)
used to express sympathy to someone because something slightly bad has happened:
"We lost again." "Oh, hard luck!"
Example in context from the BBC (I think it's a podcast):
Callum: … Well that’s about all we have today, before we go though, the answer to
this week’s question. Which planet is mostly closest to Earth? Neil, you
said ….
Neil: I said Mars.
Callum: It’s actually Venus. Venus is actually closest to Earth for most, for most time.
So hard luck on that one.
— BBC Learning English 6 Minute English: Day-trip with a difference
'Tough luck' can go both ways — showing sympathy or indifference — so maybe best to use with care. For example, here is Novak Djokovic commiserating with Andy Murray, after beating him in last year's Australian Open:
I need to pay respect to Andy for having another great tournament. Tough luck tonight.
He's a great champion, great friend and a great professional who I'm sure will have many more chances to win this trophy.
— BBC Newsround: Novak Djokovic beats Andy Murray to win sixth Australian Open title
But the only definition given by Cambridge Dictionary is the opposite one:
tough luck
(offensive: tough shit; informal)
said to show that you have no sympathy for someone's problems or difficulties:
"They lost a lot of money on their investment." "Tough luck - they should have been more careful."