:root {
    --bg-dark: #0d1117;
    --card-bg: #161b22;
    --mks-purple: #8957e5;
    --mks-cyan: #3fb1e3;
    --text-gray: #8b949e;

    /* Alturas */
    --footer-h: 56px;
    --page-pad: max(env(safe-area-inset-left), 12px);
}

/* Raiz da aplicação ocupa a viewport visual real (100svh) */
html, body {
    height: 100%;
}

body.app-root {
    margin: 0;
    padding: 0;
    background-color: var(--bg-dark);
    color: #fff;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    overflow: hidden; /* remove scroll global */
}

/* Layout principal: cabeçalho + conteúdo + footer, sem scroll */


.page {
    height: 100svh; /* usa viewport visual de mobile */
    width: 100%;
    display: grid;
    grid-template-rows: auto 1fr auto; /* header / main / footer */
    align-items: start;
    justify-items: center;
    padding-left: var(--page-pad);
    padding-right: var(--page-pad);
    /* considera safe area no topo e fundo */
    padding-top: env(safe-area-inset-top, 8px);
    padding-bottom: env(safe-area-inset-bottom, 8px);
    box-sizing: border-box;
    max-width: 480px;   /* limita largura em telas maiores */
    margin: 10px auto; /* centraliza horizontalmente */
    padding: 10px;
}

/* Header enxuto, sem margens grandes */
.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;         /* espaçamento controlado */
    padding-top: 30px; /* aproxima do topo */
}

/* Logo menor para caber tudo */
.logo-area {
    background: white;
    width: 140px;
    height: 100px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 24px rgba(137, 87, 229, 0.35);
    will-change: transform;
}

.box-shadow {
    box-shadow: 1px 0 100px var(--mks-purple);
    border-radius: 20px;
}

.pulse-animation {
    animation: pulse 3s infinite ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 24px rgba(137, 87, 229, 0.35); }
    50% { transform: scale(1.04); box-shadow: 0 0 38px rgba(63, 177, 227, 0.5); }
    100% { transform: scale(1); box-shadow: 0 0 24px rgba(137, 87, 229, 0.35); }
}

.logo {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
}

/* Títulos compactos */
.welcome-text {
    font-size: 1.5rem;
    line-height: 1.2;
    font-weight: 700;
    margin-top: 20px;
    text-align: center;
}


.subtitle {
    color: var(--text-gray);
    font-size: 0.9rem;
    line-height: 1.25;
    margin-bottom: 20px;
    text-align: center;
}

/* Main ocupa o espaço disponível entre header e footer */
.links-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: start;
    gap: 12px;
    padding: 10px 30px;
    overflow: hidden; /* evita criar scroll */
}

/* Cartões compactos e clicáveis */

.link-card {
    margin-bottom: 4%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--card-bg);
    color: white;
    text-decoration: none;
    padding: 14px;
    border-radius: 100px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
    box-shadow: 1px 0 10px var(--mks-purple), -1px 0 10px var(--mks-purple);
    text-align: center;
}

.link-card i {
    font-size: 1.1rem;
    color: var(--mks-cyan);
}

.link-card:active {
    transform: scale(0.97);
    box-shadow: 0 0 20px rgba(137, 87, 229, 0.35);
    background-color: #1c2128;
}

/* Robô ajustado e com visibilidade condicional */
.robot-container {
    font-size: 2.4rem;
    color: var(--mks-cyan);
    filter: drop-shadow(0 0 10px var(--mks-purple));
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-robot {
    display: inline-block;
    animation: float 2.5s infinite ease-in-out;
    will-change: transform;
}

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(4deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

.text-shadow {
    text-shadow: 10px 2px 30px var(--mks-purple);
}

/* Footer com altura fixa */
.footer-area {
    width: 100%;
    height: var(--footer-h);
    text-align: center;
    border-top: 1px solid #21262d;
    background-color: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 ;
    box-sizing: border-box;
}

.footer-text {
    font-size: 0.75rem;
    color: #858585;
    margin: 0;
}

/* Animação de entrada dos botões */
.animate-btn {
    opacity: 0;
    transform: translateY(18px);
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: calc(var(--order) * 0.12s);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ajustes finos para telas muito baixas (por exemplo, com teclado ou barras grandes) */
@media (max-height: 680px) {
    .logo-area { width: 128px; height: 92px; }
    .welcome-text { font-size: 1.4rem; }
    .subtitle { font-size: 0.86rem; }
    .link-card { padding: 12px; }
    .robot-container { font-size: 2.2rem; }
}

@media (max-height: 600px) {
    .robot-container { display: none; } /* esconde robô para garantir que tudo caiba */
    .links-container { gap: 10px; }
}

@media (min-width: 768px) {
    .page { max-width: 520px; }
}
