* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=Audiowide&display=swap');

:root {
    --bg-primary: #0a0e27;
    --bg-secondary: #151b3d;
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --accent: #667eea;
    --accent-hover: #5a67d8;
    --divirta-se: #653fe1;
    --card-bg: #1a1f3a;
    --shadow: rgba(0, 0, 0, 0.3);
}

[data-theme="light"] {
    --bg-primary: #f7fafc;
    --bg-secondary: #edf2f7;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --accent: #667eea;
    --accent-hover: #5a67d8;
    --card-bg: #ffffff;
    --shadow: rgba(0, 0, 0, 0.1);
}

body {
    font-family: "Audiowide", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
    min-height: 100vh;
}

header {
    background: var(--bg-secondary);
    padding: 0px;
    box-shadow: 0 4px 6px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background 0.3s ease;
    font-family: "Audiowide", sans-serif;
    height: 8vh;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
        var(--bg-secondary),
        var(--bg-secondary),
        var(--bg-secondary),
        var(--bg-secondary),
        var(--bg-secondary),
        var(--accent),
        var(--bg-secondary));
    background-size: 200% auto;
    animation: border-shine 15s linear infinite;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#headerContent {
    max-width: 100vw;
    justify-content: space-between;
    align-items: center;
    display: flex;
    padding: 0 2rem;
    margin: 0 auto;
    height: 8vh;
}

.logo {
    font-weight: 400;
    font-size: 2rem;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-menu li {
    cursor: pointer;
    padding: 0 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    color: var(--text-secondary);
    align-content: center;
    object-position: center;
    object-fit: cover;
    margin-top: 10px;
    height: 7vh;
}

.nav-menu li:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
}

.nav-menu li.active {
    font-weight: bold;

}
.menu-logo {
    width: 10vw;
    height: auto;
}
.menu-logo.arcade {
    width: 3.5vw;
    height: auto;
}
.menu-logo.nintendo {
    width: 8vw;
    height: auto;
}
.theme-toggle {
    cursor: pointer;
    border: transparent;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background-color: transparent;
    box-shadow: 0 2px 8px var(--shadow);
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
}

.theme-icon {
    font-size: 1.5rem;
}

main {
    max-width: 1400px;
    margin: 3rem auto;
    padding: 0 2rem;
}

/* Search Bar */
.search-div {
    margin-bottom: 2rem;
    content: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 50px;
}

.search-div input {
    width: 80%;
    padding: 0.75rem;
    border-radius: 8px;
    border: none;
    background: var(--card-bg);
    color: var(--text-primary);
    font-family: "Audiowide", sans-serif;

}
.search-div input::placeholder {
    color: var(--text-secondary);
}
.search-div input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent);
}
/* End Search Bar */

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.game-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px var(--shadow);
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px var(--shadow);
}

.game-image {
    width: 100%;
    height: 70%;
    overflow: hidden;
}

.game-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.game-card:hover .game-img {
    transform: scale(1.1);
}

.game-title {
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    margin-top: 1rem;
}
.game-console {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: oblique;
    text-align: center;
    margin-bottom: 1rem;
}


/* Footer */

footer {
    margin-top: 4rem;
    position: relative;
    padding: 4rem 2rem 2rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-top: none;
}
footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1.2px;
    background: linear-gradient(
        90deg,
        var(--bg-secondary),
        var(--bg-secondary),
        var(--bg-secondary),
        var(--bg-secondary),
        var(--bg-secondary),
        var(--accent),
        var(--bg-secondary),
        var(--bg-secondary)
    );
    background-size: 200% 100%;
    animation: border-shine 10s linear infinite;
}
@keyframes border-shine {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

footer>div:first-child {
    max-width: 1400px;
    margin: 0 auto;
}

footer>div:first-child>div>div {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

footer h4 {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

footer ul {
    list-style: none;
    padding: 0;
}

footer ul li {
    margin-bottom: 1rem;
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--accent);
}

footer p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

footer .bi {
    font-size: 1.5rem;
    margin-right: 1rem;
}

footer>div:last-child {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--card-bg);
    text-align: center;
}

footer>div:last-child p {
    margin: 0;
}

footer>div:last-child strong {
    color: var(--text-primary);
}

.footer-logo {
    display: inline-block;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.social-links {
    margin-top: 1.5rem;
}

.social-links a {
    display: inline-block;
    margin-right: 1rem;
    color: var(--text-secondary);
    transition: transform 0.3s ease, color 0.3s ease;
}

.social-links a:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

@media (max-width: 768px) {
    footer>div:first-child>div>div {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    footer>div:first-child>div>div {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    footer {
        padding: 2rem 1rem;
    }
}

/* Scroll-to-top button */
.back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 1vw;
    background-color: transparent;
    border: none;
    border-radius: 10%;
    cursor: pointer;
    font-size: 1.8rem;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px var(--shadow);
    transition: background-color 0.3s ease, transform 0.3s ease;
    z-index: 1000;
}

.back-to-top-btn:hover {
    background-color: transparent;
    transform: scale(1.1)
}
/* End Scroll-to-top button */


.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    header {
        padding: 10px;
    }

    .logo {
        max-width: 65vw;
        font-size: 1.30rem;
        padding: 10px 0px 10px 5px;
    }
    .nav-menu li {
        align-items: center;
        height: 20vw;
        background-color: var(--accent);
    }

    .menu-logo {
        width: 44vw;
        height: auto;
    }
    .menu-logo.arcade {
        width: auto;
        height: 100%;
    }
    .menu-logo.nintendo {
        width: auto;
        height: 100%;
    }

    .header-content {
        flex-wrap: wrap;
    }

    .hamburger {
        display: flex;
        order: 2;
    }

    .logo {
        order: 1;
    }

    nav {
        order: 3;
        width: 100%;
        margin-top: 1rem;
    }

    .nav-menu {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
        display: none;
    }

    .nav-menu.active {
        display: flex;
    }

    .theme-toggle {
        order: 2;
        margin-left: auto;
        margin-right: 1rem;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
}


/* Reading bar (top progress indicator) */
#readingBar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    width: 0%;
    background: var(--accent);
    z-index: 10000;
    transition: width 260ms ease-out;
}

.reading-bar-placeholder {
    /* keep page flow if needed for non-fixed fallback */
    height: 4px;
}

/* Clear link style */
.clear-link {
    text-decoration: none;
    color: inherit;
}

/* Games Pages */
/* Estilos específicos para games.html */
#gameMain {
    max-width: 98vw;
    margin: 3rem auto;
    padding: 0 2rem;
}
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: transparent;
    color: white;
    padding: 0.35rem 0.55rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px var(--shadow);
    border: none;
    cursor: pointer;
    font-size: 1.5rem;

}
.back-button:hover {
    background: transparent;
    transform: translateY(-2px);
    transform: scale(1.3);
    box-shadow: 0 6px 16px var(--shadow);
}
.game-container {
    margin-top: 2rem;
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

/* Frame do jogo (lado esquerdo) - ocupa 3/4 da largura */
#gameFrame {
    flex: 3;
    background: var(--bg-primary);
    border-radius: 12px;
    aspect-ratio: 16/9;
    overflow: hidden;
    border: 2px solid var(--accent);


/* É importante que o contêiner tenha uma posição diferente de 'static' */
    position: relative;
    overflow: auto; /* Garante barras de rolagem se necessário */
    /* A propriedade chave: permite redimensionar em ambas as direções */
    resize: both;
    min-width: 400px; /* Limites mínimos para não sumir */
    min-height: 300px;
    border: 1px solid #ccc; /* Ajuda o usuário a ver a alça de redimensionamento */

}

#gameFrame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Painel de informação (lado direito) - ocupa 1/4 da largura */
#gameInfo {
    flex: 1;
    padding: 1.5rem;
    background: color-mix(in srgb, var(--bg-secondary) 70%, white 10%);
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent 70%);
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
    min-width: 250px;
    box-shadow: 0 4px 12px var(--shadow);
}
#gameInfo .game-cover {
    width: 60%;
    display: block; /* torna a imagem um bloco para que margin auto funcione */
    margin: 0 auto 1.5rem; /* centraliza horizontalmente e mantém espaçamento inferior */
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow);
}

#gameInfo h2 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

#gameInfo h3 {
    color: var(--accent);
    margin-top: 2rem;
    font-size: 1.2rem;
    text-align: center;
}
#gameInfo h4 {
    color: var(--divirta-se);
    margin-top: 1rem;
    font-size: 1.2rem;
    text-align: center;
}

@media (max-width: 1350px) {
    .game-container {
        flex-direction: column;
    }
    #gameMain {
        padding: 0 0.5rem;
    }

    #gameFrame, #gameInfo {
        width: 100%;
        flex: none;
    }
    #gameFrame {
        min-width: 200px;
        width: 100%;
        height: 85vh;
    }
}