@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #0a0a0f;
    --panel: #16162b;
    --panel-glow: #1a1a2e;
    --text: #e2e8f0;
    --muted: #6b7280;
    --purple: #8b5cf6;
    --purple-grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    --panel-border: linear-gradient(135deg, rgba(139, 92, 246, 0.3) 0%, rgba(59, 130, 246, 0.2) 50%, rgba(139, 92, 246, 0.3) 100%);
    --halo-border: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.4));
    --line: rgba(255, 255, 255, 0.08);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    background: var(--bg);
    min-height: 100vh;
    color: var(--text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Centralização específica apenas para a Home */
body[data-page="home"] {
    height: 100vh;
    overflow: hidden;
    justify-content: center;
}

/* Elementos de Fundo Espaciais Dinâmicos */
#stars {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    background: #e2e8f0;
    border-radius: 50%;
    animation: pulse var(--d, 3s) var(--delay, 0s) infinite alternate ease-in-out;
}

@keyframes pulse {
    0% { opacity: 0.1; transform: scale(1); }
    100% { opacity: 0.7; transform: scale(1.2); }
}

#glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.15), transparent 70%);
    filter: blur(60px);
    pointer-events: none;
    will-change: transform;
    z-index: 0;
}

/* ==========================================
   ESTRUTURA DO TOPBAR / HEADER (PÁGINA KEY)
   ========================================== */
.topbar {
    position: sticky;
    top: 12px;
    z-index: 20;
    width: min(1120px, calc(100% - 24px));
    height: 64px;
    background: rgba(22, 22, 43, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    margin-bottom: 30px;
}

.topbar .brand {
    margin: 0;
    box-shadow: none;
    background: transparent;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.topbar .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--purple-grad);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
}

.topbar nav {
    display: flex;
    gap: 20px;
}

.topbar nav a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.2s;
}

.topbar nav a:hover {
    color: #fff;
}

/* ==========================================
   ESTRUTURA DOS CARDS PREMIUM (HOME E KEY)
   ========================================== */
.card-wrap {
    position: relative;
    z-index: 1;
    border-radius: 24px;
    padding: 2px;
    background: var(--panel-border);
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.1);
    width: min(440px, calc(100% - 24px));
    margin-bottom: 24px;
}

body[data-page="home"] .card-wrap {
    width: 360px;
}

.card-wrap::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 24px;
    padding: 1px;
    background: var(--halo-border);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: borderGlow 3s ease-in-out infinite alternate;
}

@keyframes borderGlow {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

.card {
    position: relative;
    background: linear-gradient(180deg, var(--panel-glow) 0%, var(--panel) 100%);
    padding: 38px 30px;
    border-radius: 22px;
    width: 100%;
    text-align: center;
    overflow: hidden;
}

body[data-page="home"] .card {
    padding: 44px 38px 38px;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.5), rgba(59, 130, 246, 0.3), transparent);
}

/* Elemento de marca central da Home */
body[data-page="home"] .brand {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: var(--purple-grad);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    position: relative;
    overflow: hidden;
    color: #fff;
}

h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #e2e8f0 0%, #c4b5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

p {
    color: var(--muted);
    margin-bottom: 24px;
    font-size: 0.9rem;
    font-weight: 500;
}

body[data-page="home"] p {
    margin-bottom: 32px;
}

/* ==========================================
   COMPONENTES EXCLUSIVOS DO KEY SYSTEM
   ========================================== */
.label {
    display: block;
    color: #a78bfa;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    margin-bottom: 8px;
}

/* Barra de progresso premium */
.progress-container {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--line);
    padding: 4px;
    border-radius: 99px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    position: relative;
}

.progress-bar {
    height: 10px;
    width: 0%;
    background: var(--purple-grad);
    border-radius: 99px;
    transition: width 0.4s ease;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
}

.timer {
    position: absolute;
    right: 16px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #cbd5e1;
}

/* Terminal de logs */
.terminal {
    background: rgba(5, 5, 10, 0.75);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 16px;
    text-align: left;
    font-family: monospace;
    font-size: 0.82rem;
    display: grid;
    gap: 6px;
    min-height: 110px;
    align-content: start;
    margin-bottom: 16px;
}

.terminal span {
    color: #a78bfa;
    opacity: 0.9;
}

/* Caixa de tarefas secundárias */
.tasks-box {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Resultado da Chave Gerada */
.key-result {
    margin-top: 20px;
    padding: 20px;
    border-radius: 16px;
    background: rgba(139, 92, 246, 0.04);
    border: 1px dashed rgba(139, 92, 246, 0.3);
    text-align: center;
}

.generated-key {
    margin: 12px 0;
    padding: 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.5);
    word-break: break-all;
    color: #fff;
    font-family: Consolas, monospace;
    font-size: 0.95rem;
    border: 1px solid var(--line);
}

.key-result small {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    margin-top: 10px;
}

/* ==========================================
   BOTÕES MODERNOS COM EFEITOS E ESTILOS
   ========================================== */
button, .btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

button:disabled, .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

button:not(:disabled):active, .btn:not(:disabled):active {
    transform: scale(0.98) !important;
    transition: transform 0.1s;
}

/* Botão Roxo Principal (Get Key / Actions) */
.key, .btn.primary {
    background: var(--purple-grad);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
    color: #fff;
    margin-top: 10px;
}

.key:not(:disabled):hover, .btn.primary:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.4);
}

.key::after, .btn.primary::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent);
    border-radius: 14px 14px 0 0;
}

/* Botão Secundário (Sponsor / Tasks) */
.btn.ghost {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
    color: #e2e8f0;
}

.btn.ghost:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Botão Discord */
.discord {
    background: #2d2d44;
    border: 1px solid #3f3f5e;
    color: #a78bfa;
    margin-top: 10px;
}

.discord:hover {
    transform: translateY(-2px);
    background: #363652;
    border-color: #6366f1;
    color: #c4b5fd;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.2);
}

svg.icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
    flex-shrink: 0;
}

/* ==========================================
   SEÇÕES DE ANÚNCIOS (ZONA DE MONETIZAÇÃO)
   ========================================== */
.ad-section {
    width: min(440px, calc(100% - 24px));
    margin: 20px 0;
    text-align: center;
    z-index: 1;
}

.ad-label {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 10px;
    font-weight: 600;
}

.native-slot {
    min-height: 250px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.25);
    overflow: hidden;
    backdrop-filter: blur(4px);
}

.native-slot > span {
    color: var(--muted);
    font-size: 0.85rem;
}

/* ==========================================
   PAREDE ANTI-ADBLOCK PRESERVADA
   ========================================== */
#adblockWall {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 0, 9, 0.96);
    z-index: 99999;
    backdrop-filter: blur(16px);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#adblockWall.active {
    display: flex;
}

.adblock-box {
    background: linear-gradient(180deg, #1e112a 0%, #11071c 100%);
    border: 1px solid rgba(236, 72, 153, 0.3);
    padding: 40px 30px;
    border-radius: 24px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.adblock-box h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fff 0%, #f472b6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.adblock-box p {
    color: #b8a9ca;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 28px;
}

.adblock-box button {
    background: linear-gradient(135deg, #ec4899 0%, #d946ef 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
}

/* Utilitários */
.hidden {
    display: none !important;
}

/* Responsividade Geral */
@media (max-width: 480px) {
    .card {
        padding: 30px 20px;
    }
    .topbar {
        padding: 0 16px;
    }
    .topbar nav {
        gap: 12px;
    }
}
