/* --- VARIÁVEIS E RESET --- */
:root {
    --primary: #00d9ff;    /* Azul Neon */
    --secondary: #bd00ff;  /* Roxo Neon (Tutorial) */
    --danger: #ff0055;     /* Vermelho (Erro/Like) */
    --dark: #0a0a0a;
    --dark-card: #161b22;
    --text: #ffffff;
    --gray: #8b949e;
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--dark);
    color: var(--text);
    font-family: var(--font-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- HEADER & BARRA SOCIAL --- */
header {
    background-color: var(--dark-card);
    padding: 1rem 2rem;
    display: flex;
    flex-direction: column; 
    align-items: center;
    gap: 1rem;
    border-bottom: 2px solid var(--primary);
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.2);
}

.social-bar { display: flex; gap: 15px; margin-bottom: 5px; }
.social-icon { width: 30px; height: 30px; cursor: pointer; transition: 0.3s; filter: grayscale(0); }
.social-icon:hover { filter: grayscale(0); transform: scale(1.2); }
.social-icon.disabled { opacity: 0.3; cursor: not-allowed; }

.header-top { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 1200px; }
.logo { font-size: 1.8rem; font-weight: bold; color: var(--primary); text-shadow: 0 0 10px var(--primary); text-decoration: none; }

nav { display: flex; gap: 15px; align-items: center; }
.btn-nav { text-decoration: none; color: var(--text); font-weight: bold; padding: 8px 15px; border-radius: 5px; transition: 0.3s; font-size: 0.9rem; border: 1px solid transparent; }
.btn-nav:hover { background: var(--primary); color: #000; box-shadow: 0 0 15px var(--primary); }
.btn-icon { background: none; border: none; color: var(--text); font-size: 1.2rem; cursor: pointer; transition: 0.3s; }

/* --- BARRA DE PESQUISA E DROPDOWN --- */
.search-bar {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 2rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

input[type="text"], .custom-dropdown .dropdown-trigger {
    background: var(--dark-card);
    border: 1px solid #30363d;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}

input[type="text"]:focus, .dropdown-trigger:hover {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 217, 255, 0.3);
}

/* Dropdown Customizado */
.custom-dropdown { position: relative; flex: 1; min-width: 220px; cursor: pointer; user-select: none; }
.dropdown-trigger { display: flex; justify-content: space-between; align-items: center; width: 100%; }

.dropdown-options { 
    position: absolute; top: calc(100% + 5px); left: 0; width: 100%; 
    background: var(--dark-card); border: 1px solid var(--primary); 
    border-radius: 8px; z-index: 100; display: none; 
    max-height: 250px; overflow-y: auto;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    scrollbar-width: thin; scrollbar-color: var(--primary) transparent;
}

.custom-dropdown.active .dropdown-options { display: block; animation: fadeIn 0.2s ease-out; }
.option-item { padding: 12px 20px; cursor: pointer; transition: 0.2s; border-bottom: 1px solid #30363d; }
.option-item:last-child { border-bottom: none; }
.option-item:hover, .option-item.selected { background: var(--primary); color: #000; font-weight: bold; padding-left: 25px; }

/* Scrollbar Webkit */
.dropdown-options::-webkit-scrollbar { width: 6px; }
.dropdown-options::-webkit-scrollbar-thumb { background-color: var(--primary); border-radius: 10px; }
.dropdown-options::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }

/* --- GRID E CARDS DE JOGOS --- */
main { max-width: 1200px; margin: 0 auto; padding: 1rem; width: 100%; }
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2rem; }

.game-card {
    background-color: var(--dark-card);
    border-radius: 12px;
    overflow: hidden;
    transition: 0.3s;
    border: 1px solid #30363d;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative; 
}
.game-card:hover { transform: translateY(-5px); border-color: var(--primary); box-shadow: 0 5px 15px rgba(0, 217, 255, 0.1); }

.game-img { width: 100%; height: 160px; object-fit: cover; border-bottom: 1px solid #30363d; display: block; }
/* Suporte para Picture Tag (WebP) */
.game-card picture { display: block; width: 100%; height: 160px; overflow: hidden; }

.game-info { padding: 1.5rem; display: flex; flex-direction: column; flex: 1; }

.tags-wrapper { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.category-tag { 
    font-size: 0.75rem; background: #21262d; padding: 5px 12px; 
    border-radius: 20px; color: var(--primary); border: 1px solid rgba(0, 217, 255, 0.1);
    font-weight: bold; text-transform: uppercase;
}

.game-info h3 { margin-bottom: 8px; font-size: 1.3rem; color: #fff; }
.game-info p { color: var(--gray); font-size: 0.9rem; line-height: 1.4; margin-bottom: 1.5rem; }

/* Botões nos Cards */
.actions-container { margin-top: auto; display: flex; gap: 10px; }
.download-btn, .tutorial-btn { flex: 1; padding: 10px; border-radius: 6px; border: none; font-weight: bold; cursor: pointer; transition: 0.3s; font-size: 0.85rem; display: flex; align-items: center; justify-content: center; gap: 5px; }

.download-btn { background: var(--primary); color: #000; }
.download-btn:hover { background: #00b8d9; }

.tutorial-btn { background: transparent; border: 1px solid var(--secondary); color: var(--secondary); }
.tutorial-btn:hover { background: var(--secondary); color: #fff; }
.tutorial-btn.disabled { opacity: 0.4; cursor: not-allowed; border-color: #555; color: #555; }

/* --- BOTÃO DE LIKE --- */
.like-btn {
    background: transparent;
    border: 1px solid var(--gray);
    color: var(--gray);
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 60px;
}

.like-btn:hover { border-color: var(--danger); color: var(--danger); background: rgba(255, 0, 85, 0.1); }
.like-btn:disabled { opacity: 0.7; cursor: wait; }

/* Estado "Curtido" */
.like-btn.liked {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.4);
    animation: pop 0.3s ease;
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* --- CARDS ESSENCIAIS --- */
.game-card.essential-card { max-width: 240px; margin: 0 auto; }
.game-card.essential-card p {
    font-size: 0.85rem; margin-bottom: 12px; color: var(--gray);
    display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical;  
    overflow: hidden; text-overflow: ellipsis; min-height: 2.5em; 
}

/* --- SKELETON LOADING --- */
.skeleton { background: linear-gradient(90deg, #161b22 25%, #21262d 50%, #161b22 75%); background-size: 200% 100%; animation: loading 1.5s infinite; }
@keyframes loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-card { border: 1px solid #222; pointer-events: none; }

/* --- TOAST NOTIFICATIONS --- */
#toast-container {
    position: fixed; top: 20px; right: 20px; z-index: 9999;
    display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}

.toast {
    background: var(--dark-card); color: var(--text); padding: 12px 20px;
    border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    display: flex; align-items: center; gap: 12px;
    min-width: 250px; max-width: 350px; border-left: 4px solid var(--gray);
    font-size: 0.9rem; pointer-events: auto;
    animation: slideIn 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards, fadeOut 0.5s ease 3.5s forwards;
    opacity: 0; 
}

.toast.success { border-left-color: var(--primary); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--secondary); }
.toast i { font-size: 1.1rem; }
.toast.success i { color: var(--primary); }
.toast.error i { color: var(--danger); }
.toast.info i { color: var(--secondary); }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-20px); pointer-events: none; } }

/* --- MODAL POPUP (Legado) --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; z-index: 1000; transition: 0.3s; backdrop-filter: blur(5px); }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-box { background: var(--dark-card); padding: 2.5rem; border-radius: 15px; border: 1px solid var(--primary); text-align: center; max-width: 450px; width: 90%; transform: scale(0.8); transition: 0.3s; box-shadow: 0 0 30px rgba(0, 217, 255, 0.2); }
.modal-overlay.active .modal-box { transform: scale(1); }
.modal-title { font-size: 1.6rem; margin-bottom: 12px; color: var(--primary); font-weight: bold; }
.modal-msg { color: #ccc; margin-bottom: 25px; font-size: 1rem; line-height: 1.5; }
.modal-close-btn { background: transparent; border: 2px solid var(--primary); color: var(--primary); padding: 10px 25px; border-radius: 6px; cursor: pointer; font-weight: bold; transition: 0.2s; }
.modal-close-btn:hover { background: var(--primary); color: #000; }

/* --- PÁGINA DE APOIO / PIX --- */
.apoio-container { flex: 1; display: flex; justify-content: center; align-items: center; padding: 2rem; width: 100%; }
.card-apoio { background: var(--dark-card); padding: 2.5rem; border-radius: 15px; text-align: center; max-width: 450px; width: 100%; border: 2px solid var(--primary); box-shadow: 0 0 30px rgba(0, 217, 255, 0.15); }
.pix-area { margin-top: 20px; background: #fff; padding: 15px; border-radius: 10px; display: inline-block; }
#qr-code { width: 200px; height: 200px; }
.copy-area { margin-top: 15px; display: flex; gap: 10px; }
.copy-area input { flex: 1; padding: 8px; border-radius: 5px; border: 1px solid #ddd; font-size: 0.8rem; }
.copy-area button { padding: 8px 15px; background: var(--primary); border: none; border-radius: 5px; cursor: pointer; font-weight: bold; }

/* --- PÁGINA 404 --- */
.error-container { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 80vh; text-align: center; padding: 20px; }
.error-code { font-size: 8rem; font-weight: bold; color: var(--dark-card); -webkit-text-stroke: 2px var(--danger); text-shadow: 0 0 20px rgba(255, 0, 85, 0.5); line-height: 1; }
.sloth-icon { font-size: 4rem; color: var(--primary); margin-bottom: 20px; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }

/* --- FOOTER --- */
footer { text-align: center; padding: 2rem; border-top: 1px solid #30363d; color: var(--gray); margin-top: auto; font-size: 0.9rem; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* --- UTILITÁRIOS & BOTÕES GERAIS (NOVO) --- */
.text-center { text-align: center; width: 100%; display: block; }

.btn-back-standard {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    text-decoration: none; color: var(--primary) !important; border: 1px solid var(--primary) !important;
    padding: 10px 25px; border-radius: 8px; font-weight: bold; transition: 0.3s;
    background: transparent; font-size: 1rem;
}
.btn-back-standard:hover {
    background: var(--primary) !important; color: #000 !important;
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.4); transform: translateY(-3px);
}
.btn-back-standard::before {
    content: '\f060'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
}