/* ===================== ATTOM STYLES ===================== */
/* Estilos específicos para o jogo Attom */

/* 1. Container principal com espaçamento correto da navbar */
#attom-container {
    position: relative;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px;
    padding-top: 100px; /* Espaço para a navbar fixa */
    box-sizing: border-box;
}

/* 2. App container */
#attom-app {
    width: 100%;
    min-height: calc(100vh - 160px);
    position: relative;
    overflow: hidden;
    background: radial-gradient(1200px 800px at 80% -20%, #1a1440 0%, rgba(26,20,64,0) 60%),
                radial-gradient(1000px 700px at -10% 110%, #0c3c4c 0%, rgba(12,60,76,0) 60%),
                linear-gradient(160deg, #0b0b0d, #13131a 60%, #0a0a10);
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(0,0,0,.35);
}

/* 3. Shell com grid correto */
.attom-shell {
    position: relative;
    height: 100%;
    min-height: calc(100vh - 160px);
    width: 100%;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
}

/* 4. Navegação de etapas compacta e não sobreposta */
.attom-navigation-steps {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: clamp(10px, 2vw, 20px);
    z-index: 3;
    flex-wrap: wrap;
    padding-top: 25px;
}

.attom-step {
    color: #666;
    font-size: clamp(14px, 1.65vw, 17px);
    transition: color 0.3s;
    text-align: center;
}

.attom-step.active {
    color: #8a2be2;
}

/* 5. Header do Attom com logo */
.attom-header {
    padding: 14px 20px;
    backdrop-filter: blur(6px);
    background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 16px;
}

.attom-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.1);
}

.attom-header h1 {
    margin: 0;
    font-weight: 700;
    letter-spacing: .3px;
    font-size: clamp(18px, 3vw, 24px);
}

.attom-header h1 .attom-tag {
    font-weight: 500;
    color: #a9abb6;
    font-size: .6em;
    margin-left: .4em;
}

/* 6. Main sem padding extra */
.attom-main {
    position: relative;
    overflow: hidden;
    padding: 0;
}

/* 7. Views ajustadas */
.attom-view {
    position: absolute;
    inset: 0;
    display: none;
    padding: clamp(16px, 2vw, 28px);
    overflow-y: auto;
    overflow-x: hidden;
}

.attom-view.active {
    display: block;
}

/* 8. Card base */
.attom-card {
    max-width: 980px;
    margin: 0 auto;
    padding: clamp(18px, 2vw, 28px);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(0,0,0,.35);
}

/* 9. IMPORTANTE: Hero com grid de 2 colunas no desktop */
.attom-hero {
    display: grid;
    gap: 22px;
    align-items: start; /* Mudado de center para start */
    grid-template-columns: 1fr; /* Mobile first */
}

/* Layout de 2 colunas para desktop */
@media (min-width: 768px) {
    .attom-hero {
        grid-template-columns: 1.2fr .8fr; /* Proporção original mantida */
    }
}

.attom-hero h2 {
    font-size: clamp(24px, 3.5vw, 44px);
    margin: 0 0 12px 0;
    line-height: 1.05;
}

.attom-hero p {
    color: #a9abb6;
    margin: 10px 0;
    font-size: clamp(14px, 2vw, 15px);
}

/* 10. Elementos UI */
.attom-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
    align-items: center;
}

.attom-btn {
    appearance: none;
    cursor: pointer;
    user-select: none;
    border-radius: 12px;
    border: 1px solid transparent;
    padding: 12px 16px;
    font-weight: 600;
    letter-spacing: .2px;
    background: linear-gradient(180deg, #ffffff10, #ffffff05);
    color: #f7f7fb;
    transition: transform .06s ease, box-shadow .2s ease, border-color .2s ease;
    font-size: clamp(14px, 2vw, 16px);
}

.attom-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.attom-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    background: #333;
    border-color: rgba(255,255,255,0.1);
    box-shadow: none;
}

.attom-btn-primary {
    background: radial-gradient(80% 200% at 10% -40%, #7ae6ff40 0%, transparent 60%),
                radial-gradient(120% 160% at 100% 140%, #b58cff40 0%, transparent 60%),
                linear-gradient(180deg, #2a2a47, #1a1a2b);
    border-color: #5fd6ff66;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 8px 24px rgba(122,230,255,.15);
}

.attom-btn-ghost {
    background: transparent;
    border-color: rgba(255,255,255,0.14);
    color: #f7f7fb;
}

.attom-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.06);
}

/* 11. Elementos de formulário */
.attom-textarea {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.04);
    color: #f7f7fb;
    padding: 12px 14px;
    outline: none;
    caret-color: #7ae6ff;
    font-family: inherit;
    font-size: 15px;
    min-height: 130px;
    resize: vertical;
}

.attom-label {
    font-size: 13px;
    color: #a9abb6;
    margin-bottom: 6px;
}

.attom-hint {
    font-size: 12px;
    color: #a9abb6;
    margin-top: 8px;
    display: flex;
    align-items: center;
}

.attom-muted {
    color: #a9abb6;
}

.attom-error {
    color: #ff6b6b;
    margin-top: 8px;
    font-size: 13px;
    display: none;
}

.attom-error.show {
    display: block;
}

.attom-loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: #7ae6ff;
    border-radius: 50%;
    animation: attom-spin 0.8s linear infinite;
}

@keyframes attom-spin {
    to { transform: rotate(360deg); }
}

/* 12. Container das orbs SEM scroll */
.attom-orbs-container {
    position: relative;
    width: 100%;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px; /* Reduzido de 20px */
    box-sizing: border-box; /* IMPORTANTE: adicione isso */
}

/* 13. Grid das orbs otimizado */
.attom-orbs-grid {
    display: grid;
    gap: 4px; /* Reduzido para mobile */
    grid-template-columns: repeat(auto-fit, minmax(35px, 1fr));
    max-width: 100%;
    width: 100%;
    justify-content: center;
    padding: 5px; /* Reduzido */
    box-sizing: border-box; /* IMPORTANTE */
}

.attom-orb {
    aspect-ratio: 1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    position: relative;
    font-weight: 700;
    width: 100%; /* Mudança importante */
    height: auto; /* Mudança importante */
    min-width: 30px; /* Tamanho mínimo */
    max-width: 50px; /* Tamanho máximo */
}

.attom-orb:hover {
    transform: scale(1.1);
    z-index: 5;
}

.attom-orb-number {
    position: absolute;
    font-size: clamp(16px, 2.5vw, 20px);
    font-weight: 800;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    pointer-events: none;
}

.attom-orb.exploding {
    animation: attom-explode 0.8s ease-out forwards;
}

@keyframes attom-explode {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
    100% { transform: scale(0); opacity: 0; }
}

.attom-orb.selected {
    animation: attom-pulse-glow 1.5s ease-in-out infinite;
}

@keyframes attom-pulse-glow {
    0%, 100% { transform: scale(1); box-shadow: 0 0 30px currentColor; }
    50% { transform: scale(1.1); box-shadow: 0 0 50px currentColor; }
}

/* 14. Resultado dramático */
.attom-dramatic {
    display: grid;
    place-items: center;
    text-align: center;
    gap: 16px;
    height: 100%;
    min-height: 300px;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    background: radial-gradient(650px 420px at 50% -10%, rgba(186,164,255,0.22), transparent 70%),
                radial-gradient(650px 420px at 50% 110%, rgba(92,232,255,0.16), transparent 70%);
}

.attom-dramatic h2 {
    font-size: clamp(24px, 3.5vw, 50px);
    line-height: 1.1;
    margin: 0;
}

.attom-dramatic .attom-answer {
    font-size: clamp(28px, 5vw, 72px);
    letter-spacing: .8px;
    font-weight: 800;
    background: linear-gradient(180deg, #fff, #bfe9ff 60%, #7ae6ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 8px 40px rgba(122,230,255,.35);
}

.attom-fade-in {
    animation: attom-fadeIn .9s ease both;
}

@keyframes attom-fadeIn {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to { opacity: 1; transform: none; }
}

/* Ajustes na tela de resultado do Attom */
#attomFinalQuestion {
    /* Diminui o tamanho da fonte da pergunta final */
    font-size: clamp(20px, 3vw, 32px);
    opacity: 0.8; /* Deixa a pergunta um pouco mais sutil */
}

#attomFinalAnswer {
    /* Diminui o espaçamento entre as linhas da resposta */
    line-height: 1.15;
}

/* Estilo customizado para o link dos Termos do Attom */
.attom-terms-link a {
    color: var(--muted); /* Usa a cor padrão do texto sutil */
    text-decoration: none; /* Remove o sublinhado padrão */
    border-bottom: 1px dotted rgba(255, 255, 255, 0.3); /* Adiciona um sublinhado pontilhado e sutil */
    transition: all 0.2s ease; /* Animação suave */
}

.attom-terms-link a:hover {
    color: #fff; /* Cor do texto fica mais clara ao passar o mouse */
    border-bottom-color: var(--accent-fuchsia); /* O sublinhado fica rosa neon */
    border-bottom-style: solid; /* O pontilhado vira uma linha sólida */
}

.attom-start-group {
    display: flex;
    flex-direction: column; /* << ESSA É A MÁGICA: empilha os itens verticalmente */
    align-items: flex-start; 
}

/* 15. Footer */
.attom-footer {
    padding: 14px 20px;
    backdrop-filter: blur(6px);
    background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 12px;
    color: #a9abb6;
}

/* 16. MOBILE: Ajustes responsivos */
@media (max-width: 820px) {
    .attom-start-group {
        align-items: center;   /* Centraliza os itens horizontalmente */
    }

    #attom-view-orbs.attom-view {
        padding-bottom: 60px; /* Dá mais espaço embaixo */
        min-height: auto; /* Remove restrição de altura */
    }

    #attom-container {
        padding: 10px;
        padding-top: 20px;
    }
    
    #attom-app {
        min-height: calc(100vh - 120px);
    }

    .attom-desktop { display: none; }
    
    .attom-shell {
        min-height: calc(100vh - 120px);
    }
    
    .attom-navigation-steps {
        padding-top: 15px;
        gap: 8px;
    }
    
    .attom-step {
        font-size: 11px;
    }
    
    .attom-header {
        padding: 10px 15px;
    }
    
    .attom-header h1 {
        font-size: 20px;
    }

    .attom-header h1 .attom-tag {
        font-size: .65em; /* Aumenta um pouco o subtítulo */
    }
    
    .attom-logo {
        width: 32px;
        height: 32px;
    }
    
    /* IMPORTANTE: Hero em coluna única no mobile */
    .attom-hero {
        grid-template-columns: 1fr !important;
    }
    
    .attom-orbs-container {
        min-height: auto; /* Deixa crescer conforme necessário */
        padding: 10px 10px 40px 10px; /* Mais padding embaixo */
    }
    
    .attom-orbs-grid {
        gap: 5px;
        grid-template-columns: repeat(auto-fill, minmax(35px, 1fr));
        padding: 5px;
    }
    
    .attom-orb {
        width: 38px;
        height: 38px;
    }
    
    .attom-orb-number {
        font-size: 16px;
    }
    
    .attom-card.attom-hero {
        max-height: calc(100vh - 240px);
    }
}

/* Ajustes responsivos para orbs */
@media (max-width: 480px) {
    .attom-orbs-container {
        padding: 5px 5px 30px 5px; /* Mais espaço embaixo */
        min-height: auto;
    }
    
    .attom-orbs-grid {
        gap: 3px;
        padding: 2px;
        /* Força um número específico de colunas no mobile */
        grid-template-columns: repeat(7, 1fr) !important;
    }
    
    .attom-orb {
        min-width: unset;
        max-width: unset;
        font-size: 11px; /* Reduz o tamanho da fonte */
    }
    
    .attom-orb-number {
        font-size: 14px !important;
    }
}

/* Para telas muito pequenas (<380px), como iPhone SE */
@media (max-width: 380px) {
    .attom-btn {
        padding: 10px 10px;
        font-size: 12px;
    }
    .attom-orbs-grid {
        grid-template-columns: repeat(6, 1fr) !important;
    }
    .attom-orb-number {
        font-size: 13px !important;
    }
}

/* Ajustes para telas Full HD */
@media (max-width: 1920px) and (max-height: 1080px) {    
    #attom-app {
        min-height: calc(100vh - 120px);
    }

    .attom-shell {
        min-height: calc(100vh - 120px);
    }
    
    .attom-navigation-steps {
        padding-top: 15px;
        gap: 8px;
    }
    
    .attom-step {
        font-size: 11px;
    }
    
    .attom-header {
        padding: 10px 15px;
    }
    
    .attom-header h1 {
        font-size: 20px;
    }

    .attom-header h1 .attom-tag {
        font-size: .65em; /* Aumenta um pouco o subtítulo */
    }
    
    .attom-logo {
        width: 32px;
        height: 32px;
    }

    .attom-orbs-container {
        min-height: 250px;
        padding: 10px;
    }
    
    .attom-orbs-grid {
        gap: 5px;
        grid-template-columns: repeat(auto-fill, minmax(35px, 1fr));
        padding: 5px;
    }
    
    .attom-orb {
        width: 38px;
        height: 38px;
    }
    
    .attom-orb-number {
        font-size: 14px;
    }
    
    .attom-card.attom-hero {
        max-height: calc(100vh - 240px);
    }
}

/* 17. Ajustes finais */

/* Garantir que não há scroll horizontal */
body[data-page="play-attom"] {
    overflow-x: hidden;
    background: #0b0b0d;
}

/* 18. Termos e condições */
.attom-terms-box {
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 16px;
    max-height: 200px; /* Altura máxima antes de mostrar a barra de rolagem */
    overflow-y: auto; /* Adiciona a barra de rolagem quando necessário */
    font-size: 14px;
}
.attom-terms-box a {
    color: #7ae6ff;
    text-decoration: none;
}
.attom-terms-box a:hover {
    text-decoration: underline;
}
