diff --git a/components/Game.tsx b/components/Game.tsx index 5335fe2..49fcce0 100644 --- a/components/Game.tsx +++ b/components/Game.tsx @@ -274,7 +274,10 @@ export default function Game({ dailyPuzzle, genre = null, isSpecial = false, max const bonusStar = (hasWon && gameState.yearGuessed && dailyPuzzle.releaseYear && gameState.scoreBreakdown.some(item => item.reason === 'Bonus: Correct Year')) ? '⭐' : ''; const genreText = genre ? `${isSpecial ? t('special') : t('genre')}: ${genre}\n` : ''; - let shareUrl = `https://${config.domain}`; + // Use current domain from window.location to support both hoerdle.de and hördle.de + const currentHost = typeof window !== 'undefined' ? window.location.hostname : config.domain; + const protocol = typeof window !== 'undefined' ? window.location.protocol : 'https:'; + let shareUrl = `${protocol}//${currentHost}`; // Add locale prefix if not default (en) if (locale !== 'en') { shareUrl += `/${locale}`;