* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }
body { background: radial-gradient(circle at top, #1e1b4b, #0f172a); color: #ffffff; min-height: 100vh; transition: background 0.5s ease; display: flex; flex-direction: column; }

header { display: flex; justify-content: space-between; align-items: center; padding: 10px 40px; background-color: #0f172a; border-bottom: 1px solid #1e293b; box-shadow: 0 4px 20px rgba(0,0,0,0.6); position: sticky; top: 0; z-index: 100; }
.header-left, .header-right { display: flex; align-items: center; gap: 20px; }
.logo-container { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-text { font-size: 28px; font-weight: 900; color: #facc15; text-transform: uppercase; letter-spacing: 1px; }
.version-badge { background: linear-gradient(135deg, #06b6d4, #0891b2); color: #fff; font-size: 11px; font-weight: 900; padding: 2px 8px; border-radius: 10px; box-shadow: 0 0 10px rgba(6, 182, 212, 0.4); position: relative; top: -2px; }

.main-nav { display: flex; background: #1e293b; border-radius: 30px; padding: 5px; box-shadow: inset 0 2px 5px rgba(0,0,0,0.5); border: 1px solid #334155; }
.nav-item { color: #cbd5e1; text-decoration: none; font-weight: 700; font-size: 14px; padding: 10px 20px; border-radius: 25px; transition: 0.3s; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.05); }
.nav-item.active { background: linear-gradient(135deg, #facc15, #ffaa00); color: #000; box-shadow: 0 4px 10px rgba(250, 204, 21, 0.3); }

.nav-dropdown { position: relative; display: inline-block; padding-bottom: 10px; margin-bottom: -10px; } 
.nav-dropdown::after { content: ''; position: absolute; top: 100%; left: 0; width: 100%; height: 15px; }
.dropdown-toggle { padding-right: 30px; } 
.dropdown-content { display: none; position: absolute; background-color: #1e293b; min-width: 180px; box-shadow: 0px 8px 16px rgba(0,0,0,0.8); z-index: 100; border-radius: 12px; top: calc(100% + 10px); right: 0; border: 1px solid #334155; overflow: hidden; }
.nav-dropdown:hover .dropdown-content { display: block; animation: fadeIn 0.2s ease; }
.dropdown-content a { color: #e2e8f0; padding: 12px 16px; text-decoration: none; display: block; font-weight: 600; font-size: 13px; transition: 0.2s; }
.dropdown-content a:hover { background-color: #334155; color: #fff; padding-left: 20px; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

#search { padding: 10px 15px 10px 40px; border-radius: 20px; border: 1px solid #334155; outline: none; width: 220px; background-color: #1e293b; color: white; font-size: 14px; transition: 0.3s; }
.search-bar { position: relative; display: flex; align-items: center; color: #94a3b8; }
.search-bar svg { position: absolute; left: 12px; }
#search:focus { background-color: #0f172a; border-color: #06b6d4; width: 280px; box-shadow: 0 0 15px rgba(6, 182, 212, 0.3); }

.btn-random { background: linear-gradient(135deg, #a855f7, #7e22ce); border: none; border-radius: 50%; width: 40px; height: 40px; font-size: 20px; cursor: pointer; transition: 0.3s; box-shadow: 0 4px 10px rgba(168, 85, 247, 0.4); display: flex; align-items: center; justify-content: center; }
.btn-random:hover { transform: rotate(360deg) scale(1.1); }

main { padding: 30px 50px; max-width: 1400px; margin: 0 auto; flex: 1; }

.player-stats-banner { background: rgba(30, 41, 59, 0.8); border: 1px solid #334155; color: #cbd5e1; padding: 12px 20px; border-radius: 12px; text-align: center; font-size: 14px; margin-bottom: 25px; backdrop-filter: blur(5px); box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
.player-stats-banner b { color: #facc15; }

.hero-section { display: flex; gap: 20px; margin: 0 auto 40px auto; max-width: 1180px; }
.hero-featured { flex: 2.5; border-radius: 20px; position: relative; overflow: hidden; background-size: cover; background-position: center; min-height: 320px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); transition: background-image 0.5s ease-in-out; }
.hero-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to right, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.3) 50%, transparent 100%); }
.hero-content { position: absolute; bottom: 40px; left: 40px; z-index: 2; }
.hero-content h2 { font-size: 42px; color: #fff; margin-bottom: 5px; text-shadow: 2px 2px 4px rgba(0,0,0,0.9); }
.hero-content p { color: #94a3b8; font-weight: 600; margin-bottom: 20px; font-size: 16px; letter-spacing: 1px; }
.btn-play-now { background: linear-gradient(135deg, #facc15, #ffaa00); color: #000; padding: 14px 35px; border-radius: 30px; font-weight: 900; font-size: 18px; text-decoration: none; display: inline-block; transition: 0.2s; box-shadow: 0 5px 15px rgba(250, 204, 21, 0.4); }
.btn-play-now:hover { transform: scale(1.05); }

.hero-dots-container { position: absolute; bottom: 20px; right: 30px; display: flex; gap: 8px; z-index: 5; }
.hero-dot { width: 10px; height: 10px; background: rgba(255,255,255,0.4); border-radius: 50%; cursor: pointer; transition: 0.3s; box-shadow: 0 2px 5px rgba(0,0,0,0.5); }
.hero-dot.active { background: #facc15; width: 25px; border-radius: 10px; }

.hero-side { flex: 1; background: #1e293b; border-radius: 20px; padding: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.side-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #334155; margin-bottom: 15px; padding-bottom: 10px; }
.side-header h3 { font-size: 16px; color: #fff; margin: 0; }
.side-dots-container { display: flex; gap: 5px; }
.side-dot { width: 8px; height: 8px; background: #475569; border-radius: 50%; cursor: pointer; transition: 0.3s; }
.side-dot.active { background: #facc15; width: 16px; border-radius: 8px; }
.hero-side-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

.gotd-banner { display: flex; background: linear-gradient(135deg, #1e293b, #0f172a); border-radius: 20px; border: 1px solid #334155; overflow: hidden; text-decoration: none; color: white; transition: 0.3s; margin-bottom: 40px; box-shadow: 0 8px 25px rgba(0,0,0,0.4); position: relative; }
.gotd-banner:hover { transform: translateY(-5px); border-color: #facc15; box-shadow: 0 12px 35px rgba(250, 204, 21, 0.2); }
.gotd-banner::after { content: '⭐ RECOMMENDED'; position: absolute; top: 15px; right: 20px; background: #facc15; color: #000; font-weight: 900; font-size: 11px; padding: 5px 12px; border-radius: 12px; box-shadow: 0 4px 10px rgba(250,204,21,0.4); }
.gotd-img { width: 300px; min-height: 180px; object-fit: cover; border-right: 2px solid #0f172a; }
.gotd-info { padding: 30px; display: flex; flex-direction: column; justify-content: center; }
.gotd-info h3 { font-size: 26px; color: #fff; margin-bottom: 5px; }
.gotd-info p { color: #94a3b8; font-weight: 600; font-size: 14px; margin-bottom: 15px; }
.gotd-btn { background: #334155; color: #fff; padding: 10px 25px; border-radius: 8px; font-weight: bold; width: fit-content; transition: 0.2s; font-size: 14px; }
.gotd-banner:hover .gotd-btn { background: #facc15; color: #000; }

.game-section { margin: 0 auto 40px auto; max-width: 1180px; }
#main-grid-container { max-width: 1180px; margin: 0 auto; width: 100%; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.section-header h2 { font-size: 22px; color: #fff; display: flex; align-items: center; gap: 10px; margin: 0; }

.carousel-controls { display: flex; align-items: center; gap: 15px; }
.carousel-dots { display: flex; gap: 6px; align-items: center; }
.dot { width: 8px; height: 8px; background: #334155; border-radius: 50%; cursor: pointer; transition: 0.3s; }
.dot.active { background: #facc15; width: 10px; height: 10px; box-shadow: 0 0 8px rgba(250, 204, 21, 0.5); }

.carousel-arrows { display: flex; background: #1e293b; border-radius: 20px; align-items: center; box-shadow: 0 4px 10px rgba(0,0,0,0.3); border: 1px solid #334155; }
.carousel-arrows button { background: transparent; border: none; color: #facc15; font-size: 16px; font-weight: 900; padding: 4px 16px; cursor: pointer; transition: 0.2s; }
.carousel-arrows button:hover { background: rgba(255,255,255,0.05); color: #fff; }
.carousel-arrows button:first-child { border-top-left-radius: 20px; border-bottom-left-radius: 20px; }
.carousel-arrows button:last-child { border-top-right-radius: 20px; border-bottom-right-radius: 20px; }
.arrow-divider { width: 1px; height: 18px; background: #334155; }

.horizontal-grid-compact, .horizontal-grid, .suggested-grid { display: flex; gap: 20px; overflow-x: auto; padding-bottom: 15px; scrollbar-width: none; -ms-overflow-style: none; scroll-behavior: smooth; scroll-snap-type: x mandatory; }
.horizontal-grid-compact::-webkit-scrollbar { display: none; }

/* FIX DEFINTIVO: Grelha com 8 colunas e tamanho TRANCADO a 130px! */
.game-grid { 
    display: grid; 
    grid-template-columns: repeat(8, 130px); 
    gap: 25px 20px; 
    justify-content: flex-start; 
}

.game-card { text-decoration: none; text-align: center; position: relative; transition: transform 0.2s; display: flex; flex-direction: column; align-items: center; width: 130px; flex-shrink: 0; scroll-snap-align: start; }

/* Trancado a 130px para nunca se esticar e ficar quadrado como na 3.2 */
.game-grid .game-card { width: 130px; }

.game-card .img-container { width: 100%; aspect-ratio: 1 / 1; border-radius: 20px; position: relative; overflow: hidden; box-shadow: 0 6px 15px rgba(0,0,0,0.4); border: 2px solid transparent; transition: 0.3s; }
.game-card:hover .img-container { border-color: #facc15; box-shadow: 0 8px 20px rgba(250, 204, 21, 0.5); transform: translateY(-6px); }
.game-card img { width: 100%; height: 100%; object-fit: cover; }
.game-card h3 { color: #94a3b8; font-size: 13px; margin-top: 10px; font-weight: 700; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: 0.2s; }
.game-card:hover h3 { color: #fff; }

.game-badge { position: absolute; top: 12px; right: -28px; padding: 4px 30px; font-size: 10px; font-weight: 900; color: #fff; text-transform: uppercase; transform: rotate(45deg); box-shadow: 0 3px 10px rgba(0,0,0,0.6); z-index: 5; }
.badge-new { background: linear-gradient(135deg, #10b981, #059669); } 
.badge-flash { background: linear-gradient(135deg, #a855f7, #7e22ce); } 

.favorite-btn { position: absolute; top: 8px; left: 8px; background: rgba(0, 0, 0, 0.6); border: none; border-radius: 50%; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; font-size: 14px; cursor: pointer; z-index: 20; transition: 0.2s; backdrop-filter: blur(4px); }
.favorite-btn:hover { transform: scale(1.15); background: rgba(0, 0, 0, 0.9); }

.game-wrapper { max-width: 1180px; margin: 10px auto; }
.game-title-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; flex-wrap: wrap; gap: 15px; }
.game-title-bar h1 { font-size: 26px; color: #facc15; margin: 0; }
.game-player-box { box-shadow: 0 10px 40px rgba(0,0,0,0.8); border-radius: 16px; background-color: #0f172a; }
.game-frame { width: 100%; height: 700px; border: none; background-color: #000; border-radius: 16px 16px 0 0; display: flex; justify-content: center; align-items: center; overflow: hidden; }
.game-action-bar { background-color: #1e293b; padding: 12px 25px; display: flex; justify-content: space-between; align-items: center; border-radius: 0 0 16px 16px; border-top: 2px solid #334155; }
.btn-rate { background: #334155; border: none; color: white; width: 45px; height: 35px; border-radius: 8px; font-size: 18px; cursor: pointer; transition: 0.2s; }
.btn-rate:hover { transform: translateY(-2px); }
.btn-rate-like.active-rate { background: #10b981; }
.btn-rate-dislike.active-rate { background: #ef4444; }
.btn-main-fav { background: #334155; border: none; border-radius: 50%; width: 40px; height: 40px; font-size: 20px; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; }
.btn-main-fav:hover { transform: scale(1.1); background: #475569; }
.btn-action, .btn-cinema { background: #334155; color: #fff; border: none; padding: 8px 15px; border-radius: 8px; font-weight: bold; font-size: 14px; cursor: pointer; transition: 0.2s; }
.btn-action:hover, .btn-cinema:hover { background: #475569; transform: translateY(-2px); }
.btn-fullscreen { background: linear-gradient(135deg, #06b6d4, #0891b2); color: #000; border: none; padding: 8px 15px; border-radius: 8px; font-weight: 900; font-size: 14px; cursor: pointer; transition: 0.2s; }
.btn-fullscreen:hover { transform: scale(1.05); background: linear-gradient(135deg, #facc15, #ffaa00); }

.suggested-section { background-color: #1e293b; padding: 25px; border-radius: 16px; margin-top: 30px; }
.suggested-section h3 { font-size: 14px; color: #fff; text-transform: uppercase; margin-bottom: 20px; text-align: center; letter-spacing: 1px; }

body.cinema-mode { background: #000 !important; }
body.cinema-mode header { opacity: 0.05; }
body.cinema-mode header:hover { opacity: 1; }
body.cinema-mode .suggested-section { opacity: 0.1; transition: 0.5s; }
body.cinema-mode .suggested-section:hover { opacity: 1; }

footer { background-color: #0f172a; border-top: 1px solid #1e293b; margin-top: 40px; padding: 40px 40px 20px 40px; box-shadow: 0 -4px 20px rgba(0,0,0,0.3); }
.footer-content { max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; border-bottom: 1px solid #334155; padding-bottom: 30px; }
.footer-links { display: flex; gap: 30px; }
.footer-links a { color: #94a3b8; text-decoration: none; font-weight: 600; font-size: 14px; transition: 0.2s; }
.footer-links a:hover { color: #facc15; }
.btn-back-to-top { background: #334155; color: #fff; border: none; padding: 8px 20px; border-radius: 20px; font-weight: bold; cursor: pointer; transition: 0.2s; }
.btn-back-to-top:hover { background: #facc15; color: #000; transform: translateY(-2px); }
.footer-bottom { text-align: center; padding-top: 20px; color: #64748b; font-size: 12px; font-weight: 600; }
.creator-highlight { color: #facc15; font-weight: 900; letter-spacing: 0.5px; }

/* Para a grelha não quebrar em ecrãs de telemóvel e tablet */
@media (max-width: 1200px) { .game-grid { grid-template-columns: repeat(6, 130px); justify-content: center; } }
@media (max-width: 900px) { .game-grid { grid-template-columns: repeat(4, 130px); justify-content: center; } }
@media (max-width: 600px) { .game-grid { grid-template-columns: repeat(3, 130px); justify-content: center; } }