:root {
    --background-color: #f0f0f0;
    --text-color: #333;
    --primary-color: #5a67d8;
    --card-bg: #fff;
    --shadow-color: rgba(0, 0, 0, 0.1);
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    height: 100vh;
    overflow: hidden;
    user-select: none;
    /* Adiciona padding-top para não ficar atrás do header fixo */
    padding-top: 60px; 
    box-sizing: border-box;
}
.view-container {
    width: 100%;
    /* Ajusta a altura para compensar o padding-top do body */
    height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    background-image: radial-gradient(#d7d7d7 1px, transparent 1px);
    background-size: 16px 16px;
    animation: fadeIn 0.5s ease-out forwards;
}
.hidden { display: none !important; }
.fade-out { animation: fadeOut 0.3s ease-in forwards; }

/* Estilos do Menu de Perfil */
#profile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px var(--shadow-color);
    display: flex;
    justify-content: space-between; /* Lados opostos */
    align-items: center;
    padding: 0 20px;
    z-index: 2000;
    box-sizing: border-box; 
}
#profile-info { 
    display: flex;
    align-items: center;
}
#profile-pic-header {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    object-fit: cover;
    margin-right: 10px;
}
#profile-username {
    font-weight: 600;
    color: var(--text-color);
}
#profile-links { 
    display: flex;
    align-items: center;
    gap: 10px;
}
.profile-button { 
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s;
    font-size: 14px;
}
.profile-button:hover {
    background-color: #f0f0f0;
}
.profile-button.logout { 
    background-color: #e53e3e;
    color: white;
}
.profile-button.logout:hover {
    background-color: #c53030;
}

/* Estilos da Página de Login / Cadastro */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow-y: auto;
    padding-top: 0; /* Reseta o padding do body */
}
.login-container {
    background-color: #fff;
    padding: 2.5rem 3rem;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    text-align: center;
    width: 100%;
    max-width: 400px;
}
.login-container .system-logo {
    margin-bottom: 2rem;
}
.login-container h1 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
}
.login-container .form-group {
    text-align: left;
    margin-bottom: 1rem;
}
.login-container .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}
.login-container .form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    box-sizing: border-box; /* Garante que padding não afete a largura */
}
.login-container .form-button {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 1rem;
    box-sizing: border-box; /* (NOVO) Garante consistência */
    display: inline-block; /* (NOVO) Para o <a> se comportar como botão */
    text-decoration: none; /* (NOVO) Remove sublinhado do <a> */
}
/* (NOVO) Estilo do botão de cadastro */
.login-container .form-button.register-button {
    background-color: #6b7280; /* Cor cinza */
}
.login-container .form-button.register-button:hover {
    background-color: #4b5563;
}
/* (NOVO) Botão desabilitado */
.login-container .form-button:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

.login-container .error-message {
    background-color: #fed7d7;
    color: #822727;
    border: 1px solid #fbcfe8;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}
/* (NOVO) Mensagem de sucesso */
.login-container .success-message {
    background-color: #e6fffa;
    color: #234e52;
    border: 1px solid #b2f5ea;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}
/* (NOVO) Rodapé da tela de login */
.login-footer {
    text-align: center;
    color: #aaa;
    font-size: 12px;
    margin-top: 2rem;
}

/* Console Selection Styles */
#console-header { text-align: center; margin-bottom: 1rem; }
.system-logo { width: 200px; height: auto; }
#console-info { text-align: center; margin-bottom: 2rem; min-height: 80px; }
#console-name { font-size: 2.5rem; font-weight: bold; margin: 0; }
#game-count {
    font-size: 1.2rem; color: #777; background-color: #e2e8f0;
    padding: 0.25rem 0.75rem; border-radius: 999px;
    display: inline-block; margin-top: 0.5rem;
}
#carousel-container { display: flex; align-items: center; justify-content: center; width: 100%; }
#console-selection {
    display: flex; align-items: center; gap: 20px;
    padding: 20px; overflow-x: hidden; scroll-behavior: smooth;
    width: 80%; justify-content: flex-start;
}
.console-card {
    flex: 0 0 150px; height: 150px; background-color: var(--card-bg);
    border-radius: 16px; cursor: pointer; transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; justify-content: center; align-items: center;
    box-shadow: 0 4px 6px var(--shadow-color); border: 3px solid transparent;
}
.console-card.active { transform: scale(1.15); box-shadow: 0 10px 15px var(--shadow-color); border-color: var(--primary-color); }
.console-card img { width: 80%; height: auto; object-fit: contain; }
.nav-arrow { font-size: 3rem; color: #aaa; cursor: pointer; padding: 0 20px; transition: color 0.2s; }
.nav-arrow:hover { color: var(--primary-color); }

footer { position: fixed; bottom: 20px; display: flex; gap: 20px; z-index: 10; }
.prompt { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer;}
.prompt-key {
    background-color: #fff; border: 1px solid #ccc; border-radius: 50%;
    width: 24px; height: 24px; display: inline-flex;
    justify-content: center; align-items: center; font-weight: bold;
}
.version-footer { position: fixed; bottom: 5px; left: 5px; font-size: 10px; color: #aaa; }


/* Game Selection Styles */
#game-view { background-size: cover; background-position: center; transition: background-image 0.5s ease-in-out; position: relative; }
#game-view::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255, 255, 255, 0.7); z-index: 1; }
.game-selection-content { display: flex; width: 90%; height: 80%; max-width: 1400px; position: relative; z-index: 2; }
#game-list-carousel { flex: 0 0 280px; overflow-y: auto; padding: 20px 10px; display: flex; flex-direction: column; gap: 15px; scrollbar-width: none; }
#game-list-carousel::-webkit-scrollbar { display: none; }
.game-box-art { width: 100%; border-radius: 12px; cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease; border: 4px solid transparent; box-sizing: border-box; }
.game-box-art.active { transform: scale(1.05); border-color: var(--primary-color); box-shadow: 0 8px 25px rgba(0,0,0,0.2); }
#game-info-panel { flex-grow: 1; display: flex; flex-direction: column; justify-content: center; padding-left: 5%; }
#game-title { font-size: 3.5rem; font-weight: 900; margin: 0; text-shadow: 0 2px 4px rgba(0,0,0,0.1); }
#game-list-header { 
    position: absolute; 
    top: 20px; 
    left: 20px; 
    right: 20px; 
    z-index: 5; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 15px;
    /* Garante que o header não seja afetado pelo padding do body */
    margin-top: -20px;
    padding-top: 20px; 
}
#game-view-title { font-size: 2rem; font-weight: bold; color: var(--text-color); text-shadow: 0 1px 2px #fff; }
#filter-container { display: flex; width: 100%; max-width: 600px; }
#filter-input {
    flex-grow: 1; padding: 10px 15px; border-radius: 8px;
    border: 2px solid #e2e8f0; background-color: #fff;
    color: var(--text-color); font-size: 16px; box-shadow: 0 2px 4px var(--shadow-color);
}
.pagination-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; padding: 8px; background-color: rgba(255,255,255,0.8); backdrop-filter: blur(5px); border-radius: 8px; width: fit-content; max-width: 600px; box-shadow: 0 2px 4px var(--shadow-color);}
.pagination-letter { padding: 5px 10px; cursor: pointer; border-radius: 4px; font-weight: bold; transition: background-color 0.2s; }
.pagination-letter:hover { background-color: #cbd5e0; }
.pagination-letter.active { background-color: var(--primary-color); color: white; }
.pagination-letter.disabled { color: #ccc; cursor: default; background-color: transparent !important; }
.pagination-letter.disabled:hover { background-color: transparent; }

/* Lightbox Styles */
#lightbox-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s forwards;
}
#lightbox-container {
    background-color: #f0f0f0; padding: 20px; border-radius: 10px;
    width: 90%; max-width: 840px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    animation: fadeIn 0.3s forwards;
}
#lightbox-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e2e8f0; padding-bottom: 10px; margin-bottom: 10px; }
#lightbox-title { margin: 0; color: #333; }
#close-lightbox { background: none; border: none; color: #777; font-size: 24px; cursor: pointer; }
#lightbox-content { display: flex; gap: 20px; }
#lightbox-player { flex-grow: 1; }
#lightbox-player iframe { width: 100%; aspect-ratio: 4/3; border: none; background-color: #000; }
#lightbox-controls { flex-basis: 200px; flex-shrink: 0; }
#lightbox-controls h3 { margin-top: 0; color: var(--primary-color); }
#lightbox-controls ul { list-style: none; padding: 0; }
#lightbox-controls li { margin-bottom: 5px; }
@media (max-width: 800px) { #lightbox-content { flex-direction: column; } #lightbox-controls { flex-basis: auto; } }

/* Music Player Styles */
#music-mute-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: #333;
    border-radius: 50%;
    border: 2px solid #555;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.5);
    z-index: 999;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}
#music-mute-toggle svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

