@import url('https://fonts.googleapis.com/css2?family=Marcellus&display=swap');


.menu-deviling{

    position:absolute;

    top:60px;
    left:20%;

    transform:translateX(-50%);

    width: 100%;
    height:168px;

    background-image:url("../images/classes/classmenu/ocupation1.png");
    background-size:contain;
    background-repeat:no-repeat;

    pointer-events:none;
}

.sectionmains {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    font-family: 'Marcellus', serif;
    background-color: #f4e8d1; /* Fallback */
}

.game-container {
    width: 100%;
    height: 100%;
    background-image: url('../images/classes/backgroundclasses.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
}

/* --- Menu Lateral --- */
.left-menu {
    position: absolute;
    top: 5%;
    left: 10%;
    width: 364px;
    height: 886px;
    background-image: url('../images/classes/classmenu/ocupation.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    padding: 60px 20px 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}

.menu-header {
    margin-bottom: 20px;
    text-align: center;
    color: #5c4332;
}

.class-list {
    position: absolute;
    top: 15%;
    list-style: none;
    width: 100%;
    overflow-y: auto;
    scrollbar-width: none; /* Oculta scrollbar */
}

/* --- Menu Lateral (Ajuste do Hover e Active) --- */

.class-title{

    position:relative;
    display:flex;
    align-items:center;

    left:100px;

    font-size:18px;
    color:#6b4b34;
    font-weight:600;

    pointer-events:none;
}
.class-item.active .class-title{
    position:relative;
    display:flex;
    align-items:center;
    text-align: center;
    font-size:20px;
    left: 200px;
    top: 18px;
}

.class-item {
    position: relative;
    display:flex;
    align-items:center;
    width: 100%;
    height: 65px;
    margin-bottom: 15px;
    cursor: pointer;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.2s ease-in-out;
}

.class-item.active {
    width: 100%;
    height: 180px;
    position: relative;
    left: 5%;

}

.class-item:hover {
    transform: scale(1.05);
}
.class-badge {
    position: relative;
    display:flex;
    align-items:center;
    left: 78px;
    width: 59px;
    height: 59px;
}
.class-item.active .class-badge{
    display:none;
}

/* O JS vai injetar o background e o hover de cada item inline ou via classes */

/* --- Arte Principal --- */
.main-content {
    z-index: 1;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Permite clicar através do container principal */
}

.character-art {
    position: absolute;
    top: 50%;
    left: 45%;
    transform: translate(-50%, -50%);
    height: 100%;
    z-index: 5;
}

.character-art img {
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(5px 5px 15px rgba(0,0,0,0.3));
}

/* --- Informações da Classe --- */
.class-info{

    position:absolute;
    top:13%;
    right:13%;

    width:420px;

    text-align:center;

    background:none;
    box-shadow:none;
}

#class-name{
    display:flex;
    position:relative;

    font-size:4rem;
    color:#fff4e6;

    top:-40px;
    margin:0;

    -webkit-text-stroke:8px #8b5a3c;
    paint-order: stroke fill;

    text-shadow: 0 4px 6px rgba(0,0,0,0.25);
}
#class-desc {
    font-size: 1.1rem;
    color: #4a3b2c;
    line-height: 1.5;
}

.class-title-frame{

    display:inline-flex;
    justify-content:center;
    align-items:center;
    background-image:url("../images/classes/classmenu/bgjobname.png");
    background-size:100% 65%;
    background-repeat:no-repeat;
    padding: 14px 70px;
    margin-bottom: 20px;
}
/* --- Árvore de Evolução Container --- */
.evolution-container {
    position: absolute;
    bottom: 12%; 
    right: 0; /* Colado na margem direita */
    width: 50%; /* Ajuste a largura para ocupar a direita da tela */
    background: linear-gradient(90deg, rgba(175, 125, 90, 0.514) 0%, rgba(207, 154, 116, 0.5) 100%);
    border-radius: 100px 0 0 100px; /* Arredondado SÓ na esquerda */
    padding: 25px 40px;
    pointer-events: auto;
    z-index: 10;
}

.evolution-tree {
    display: flex;
    align-items: center;
    gap: 18px; /* O espaçamento será feito pelas linhas de conexão */
}

/* --- Classe Base (Ex: Merchant) --- */
.base-node {
    display: flex;
    align-items: center;
    background: rgba(162, 118, 92, 0.9); /* Marrom escuro */
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 3px 15px 3px 3px;
    border-radius: 40px;
    position: relative;
    z-index: 2;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

/* Efeito de hover suave na árvore */
.base-node:hover, .evo-item:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}
/* Linha reta saindo da Classe Base */
.base-node::after {
    content: '';
    position: absolute;
    right: -25px; /* Tamanho da linha até a bifurcação */
    top: 50%;
    width: 25px;
    height: 1.5px;
    background: rgba(255, 255, 255, 0.8);
}
/* Ajuste específico para garantir que o avatar acompanhe o destaque se necessário */
.evo-item.active .avatar {
    border-color: #fff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.base-node .avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #fff;
    margin-right: 12px;
}

.base-node .evo-name {
    color: #fff;
    font-size: 1.1rem;
    font-weight: bold;
    margin-right: 15px;
}

.base-node .evo-tier {
    color: #fff;
    font-size: 0.6rem;
    text-align: right;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- Ramificações (Branches) --- */
.branches {
    display: flex;
    flex-direction: column;
    gap: 20px; /* Espaço vertical entre as duas linhas (Ex: Blacksmith / Alchemist) */
    position: relative;
    margin-left: 25px; /* Espaço para a linha da base-node */
}

/* A linha bifurcada verticalmente "[" */
.branches::before {
    content: '';
    position: absolute;
    left: -20px; /* Posição da bifurcação */
    top: 25%; /* Alinhado ao centro da primeira linha */
    bottom: 25%; /* Alinhado ao centro da segunda linha */
    width: 20px;
    border-left: 1.5px solid rgba(255, 255, 255, 0.8);
    border-top: 1.5px solid rgba(255, 255, 255, 0.8);
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.8);
    border-radius: 3px 0 0 3px;
}

.branch-row {
    display: flex;
    align-items: center;
    gap: 35px; /* Espaço horizontal entre as evoluções na mesma linha */
}

/* --- Itens de Evolução (Caixas Claras) --- */
.evo-item {
    display: flex;
    align-items: center;
    background: #8c5b45; /* Creme claro igual da print */
    padding: 5px 15px 5px 30px; /* Padding left maior para caber o avatar sobreposto */
    height: 48px;
    border-radius: 4px; /* Quase quadrado, levemente arredondado */
    position: relative;
    min-width: 170px;
}

/* Linha horizontal conectando as classes na mesma row (Ex: Blacksmith -> Whitesmith) */
.branch-row .evo-item:not(:first-child)::before {
    content: '';
    position: absolute;
    left: -35px; /* Cobre exatamente o 'gap' do branch-row */
    top: 50%;
    width: 35px;
    height: 1.5px;
    background: rgba(255, 255, 255, 0.8);
}

/* Avatar Vazando para fora da caixa */
.evo-item .avatar {
    position: absolute;
    left: -20px; /* Puxa metade do avatar para fora */
    top: 50%;
    transform: translateY(-50%); /* Centraliza perfeitamente no eixo Y */
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #d4a373; /* Borda begezinha da imagem */
    background: #fff;
    z-index: 2;
}

.evo-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-left: 5px;
}

.evo-item .evo-name {
    font-size: 0.95rem;
    font-weight: bold;
    color: #8c5b45; /* Marrom escuro do texto */
}

.evo-item .evo-tier {
    font-size: 0.55rem;
    color: #a88d7d;
    text-align: right;
    line-height: 1.1;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Estrelinha decorativa (marca d'água no tier) */
.evo-tier::before {
    content: '✦'; /* Simula o ícone de brilho */
    color: #e0d0c1;
    font-size: 0.9rem;
}

/* Nó Base */
.base-node {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    padding: 5px 15px 5px 5px;
    border-radius: 30px;
    position: relative;
}

/* Ramificações */
.branches {
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
}

/* Linhas conectando base aos branches (Simulação com bordas) */
.branches::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 25%;
    bottom: 25%;
    width: 20px;
    border-left: 2px solid rgba(255,255,255,0.5);
    border-top: 2px solid rgba(255,255,255,0.5);
    border-bottom: 2px solid rgba(255,255,255,0.5);
    border-radius: 10px 0 0 10px;
}

.branch-row {
    display: flex;
    align-items: center;
}

/* Item Individual da Árvore */
.evo-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.6);
    padding: 5px 15px 5px 5px;
    border-radius: 30px;
}

.avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    object-fit: cover;
}

.evo-info {
    display: flex;
    flex-direction: column;
}

.evo-name {
    font-size: 0.9rem;
    font-weight: bold;
    color: #4a3b2c;
}

.evo-tier {
    font-size: 0.6rem;
    color: #7a6b5c;
    text-transform: uppercase;
}

/* Botão Fechar */
.close-btn2 {
    position: absolute;
    top: 5%;
    right: 5%;
    width: 70px;
    height: 70px;
    background-image: url('../images/classes/close.png'); /* Crie ou ajuste o caminho */
    background-size: cover;
    background-color: transparent;
    border: none;
    cursor: pointer;
    z-index: 20;
}


@media (max-width: 768px) {
    /* Impede que o conteúdo vaze e garante scroll suave */
    .sectionmains {
        overflow-y: auto;
        height: 100vh;
    }

    .game-container {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        background-attachment: fixed;
    }

    /* --- MENU SUPERIOR (Ocupação) --- */
    .left-menu {
        position: relative; /* Sai de cima da arte */
        top: 0;
        left: 0;
        width: 100%;
        height: 120px; /* Altura fixa para o topo */
        padding: 10px 0;
        background-image: none; /* Remove o pergaminho de fundo no mobile para limpar o visual */
        background-color: rgba(255, 255, 255, 0.2); 
        z-index: 20;
    }

    .menu-header { display: none; } /* Esconde o título "Occupation" para ganhar espaço */

    .class-list {
        display: flex;
        flex-direction: row; /* Itens um ao lado do outro */
        position: relative;
        top: 0;
        overflow-x: auto;
        padding: 5px 15px;
        gap: 10px;
        height: 100%;
        align-items: center;
    }

    /* Ajuste geral dos itens */
    .class-item {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        padding-left: 15px !important; /* Aumentei um pouquinho o respiro inicial */
        gap: 8px !important; 
        flex: 0 0 150px; /* Ligeiramente mais largo para caber os nomes */
        width: auto !important;
        height: 50px;
        margin-bottom: 0;
        background-size: 100% 100% !important;
    }

    /* Corrige o ícone (remove o left negativo que estava empurrando pra fora) */
    /* Força o ícone e o texto a respeitarem o flexbox (remove o left e position) */

    .class-item .class-badge {

        position: relative;

        left: -13px;

        width: 42px !important;

        height: 42px !important;

        margin: 0 !important;

    }

    /* O SEGREDO DO ALINHAMENTO ATIVO: Mais padding para pular a borda da moldura */
    .class-item.active {
        height: 60px; /* Ajustado para não ficar desproporcional */
        padding-left: 30px !important; /* Empurra o ícone e o texto para dentro da área visível */
        gap: 12px !important; /* Mais espaço entre o ícone e o nome */
    }

    /* Títulos */
    .class-item .class-title,
    .class-item.active .class-title {
        position: static !important;
        left: 0 !important;
        top: 0 !important;
        margin: 0 !important;
        font-size: 15px !important; /* Um tiquinho maior para leitura */
        font-weight: bold;
        text-align: left !important;
        color: #4a3b32; /* Cor mais fiel à referência, ajuste se necessário */
    }

    .class-item.active {
        height: 70px; /* Destaque sutil */
        left: 0;
    }

    /* --- ÁREA CENTRAL (Arte e Texto) --- */
    .main-content {
        position: relative;
        width: 100%;
        flex: 1; /* Ocupa o espaço restante */
        display: flex;
        flex-direction: column;
        pointer-events: auto;
    }

    /* --- ÁREA CENTRAL (Arte e Texto) --- */
    .character-art {
        position: relative;
        left: 25px;
        top: 100px;
        transform: none;
        height: 420px; /* Aumentado de 320px para dar bem mais destaque */
        margin-top: -10px; /* Sobe a arte um pouco para aproveitar o espaço livre no topo */
        display: flex;
        justify-content: center;
        z-index: 5;
    }

    .character-art img {
        height: 100%;
        width: auto;
        object-fit: contain;
        transform: scale(1.15); /* Amplia a imagem mantendo a qualidade e o espaço do container */
        transform-origin: bottom center; /* Faz com que a imagem cresça para cima e não vaze no texto */
    }

    .class-info {
        position: relative;
        top: -20px; /* Sobe um pouco para integrar com a arte */
        right: 0;
        width: 100%;
        padding: 0 20px;
        z-index: 10;
    }

    #class-name {
        font-size: 2.8rem;
        -webkit-text-stroke: 4px #8b5a3c;
        justify-content: center;
        top: 0;
    }
    #class-desc {
    position: relative;
    left: 0;
    top: 100px;
    font-size: 1.1rem;
    color: #4a3b2c;
    line-height: 1.5;
    }

    .class-title-frame {
        position: relative;
        left: 0px;
        top: 100px;
        padding: 5px 30px;
        background-size: 100% 100%;
    }

    /* --- ÁRVORE DE EVOLUÇÃO (Rodapé) --- */
    .evolution-container {
        position: relative;
        width: 100%;
        right: 0;
        bottom: 0;
        border-radius: 0;
        margin-top: auto; /* Empurra para o final */
        background: linear-gradient(180deg, rgba(175, 125, 90, 0.2) 0%, rgba(175, 125, 90, 0.8) 100%);
        padding: 20px 10px;
        overflow-x: auto;
    }

    .evolution-tree {
        min-width: 600px; /* Impede esmagamento dos nodes */
        justify-content: center;
    }
    /* botão fechar */
    .close-btn2{
        display: none;
    }
    /* --- ÁRVORE DE EVOLUÇÃO (Slider Horizontal) --- */
    .evolution-container {
        position: relative;
        width: 100%;
        bottom: 0;
        margin-top: auto;
        background: linear-gradient(180deg, rgba(175, 125, 90, 0.2) 0%, rgba(175, 125, 90, 0.8) 100%);
        padding: 20px 15px !important;
        
        /* Configurações do Slider */
        overflow-x: auto !important;
        scroll-snap-type: x mandatory; /* Faz o scroll "travar" nos itens */
        -webkit-overflow-scrolling: touch; /* Scroll suave no iOS */
        scrollbar-width: none; /* Esconde scrollbar no Firefox */
    }

    .evolution-container::-webkit-scrollbar {
        display: none; /* Esconde scrollbar no Chrome/Safari */
    }

    /* Força TODOS os containers da árvore a ficarem em linha horizontal */
    .evolution-tree, .branches, .branch-row {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 15px !important;
        width: max-content !important; /* Permite que cresça para fora da tela (ativando o scroll) */
        margin: 0 !important;
    }

    /* Impede que os cartões esmaguem e aplica o snap do slider */
    .base-node, .evo-item {
        flex: 0 0 auto !important;
        scroll-snap-align: start; /* Ponto de parada do scroll */
        min-width: 190px !important; /* Ajuste o tamanho da caixinha se precisar */
        margin: 0 !important;
    }

    /* Oculta as linhas verticais/horizontais de conexão do PC, pois no mobile não combinam com o slider */
    .branches::before, 
    .branch-row::before, 
    .base-node::after, 
    .branch-row .evo-item:not(:first-child)::before {
        display: none !important;
    }

}

@media (max-width: 1024px) {
    /* Impede que o conteúdo vaze e garante scroll suave */
    .sectionmains {
        overflow-y: auto;
        height: 100vh;
    }

    .game-container {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        background-attachment: fixed;
    }

    /* --- MENU SUPERIOR (Ocupação) --- */
    .left-menu {
        position: relative; /* Sai de cima da arte */
        top: 0;
        left: 0;
        width: 100%;
        height: 120px; /* Altura fixa para o topo */
        padding: 10px 0;
        background-image: none; /* Remove o pergaminho de fundo no mobile para limpar o visual */
        background-color: rgba(255, 255, 255, 0.2); 
        z-index: 20;
    }

    .menu-header { display: none; } /* Esconde o título "Occupation" para ganhar espaço */

    .class-list {
        display: flex;
        flex-direction: row; /* Itens um ao lado do outro */
        position: relative;
        top: 0;
        overflow-x: auto;
        padding: 5px 15px;
        gap: 10px;
        height: 100%;
        align-items: center;
    }

    /* Ajuste geral dos itens */
    .class-item {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        padding-left: 15px !important; /* Aumentei um pouquinho o respiro inicial */
        gap: 8px !important; 
        flex: 0 0 150px; /* Ligeiramente mais largo para caber os nomes */
        width: auto !important;
        height: 50px;
        margin-bottom: 0;
        background-size: 100% 100% !important;
    }

    /* Força o ícone e o texto a respeitarem o flexbox (remove o left e position) */

    .class-item .class-badge {

        position: relative;

        left: -13px;

        width: 42px !important;

        height: 42px !important;

        margin: 0 !important;

    }

    /* O SEGREDO DO ALINHAMENTO ATIVO: Mais padding para pular a borda da moldura */
    .class-item.active {
        height: 60px; /* Ajustado para não ficar desproporcional */
        padding-left: 30px !important; /* Empurra o ícone e o texto para dentro da área visível */
        gap: 12px !important; /* Mais espaço entre o ícone e o nome */
    }

    /* Títulos */
    .class-item .class-title,
    .class-item.active .class-title {
        position: static !important;
        left: 0 !important;
        top: 0 !important;
        margin: 0 !important;
        font-size: 15px !important; /* Um tiquinho maior para leitura */
        font-weight: bold;
        text-align: left !important;
        color: #4a3b32; /* Cor mais fiel à referência, ajuste se necessário */
    }

    .class-item.active {
        height: 70px; /* Destaque sutil */
        left: 0;
    }

    /* --- ÁREA CENTRAL (Arte e Texto) --- */
    .main-content {
        position: relative;
        width: 100%;
        flex: 1; /* Ocupa o espaço restante */
        display: flex;
        flex-direction: column;
        pointer-events: auto;
    }

    /* --- ÁREA CENTRAL (Arte e Texto) --- */
    .character-art {
        position: relative;
        left: 25px;
        top: 100px;
        transform: none;
        height: 420px; /* Aumentado de 320px para dar bem mais destaque */
        margin-top: -10px; /* Sobe a arte um pouco para aproveitar o espaço livre no topo */
        display: flex;
        justify-content: center;
        z-index: 5;
    }

    .character-art img {
        height: 100%;
        width: auto;
        object-fit: contain;
        transform: scale(1.15); /* Amplia a imagem mantendo a qualidade e o espaço do container */
        transform-origin: bottom center; /* Faz com que a imagem cresça para cima e não vaze no texto */
    }

    .class-info {
        position: relative;
        top: -20px; /* Sobe um pouco para integrar com a arte */
        right: 0;
        width: 100%;
        padding: 0 20px;
        z-index: 10;
    }

    #class-name {
        font-size: 2.8rem;
        -webkit-text-stroke: 4px #8b5a3c;
        justify-content: center;
        top: 0;
    }
    #class-desc {
    position: relative;
    left: 0;
    top: 100px;
    font-size: 1.1rem;
    color: #4a3b2c;
    line-height: 1.5;
    }

    .class-title-frame {
        position: relative;
        left: 0px;
        top: 100px;
        padding: 5px 30px;
        background-size: 100% 100%;
    }

    /* --- ÁRVORE DE EVOLUÇÃO (Rodapé) --- */
    .evolution-container {
        position: relative;
        width: 100%;
        right: 0;
        bottom: 0;
        border-radius: 0;
        margin-top: auto; /* Empurra para o final */
        background: linear-gradient(180deg, rgba(175, 125, 90, 0.2) 0%, rgba(175, 125, 90, 0.8) 100%);
        padding: 20px 10px;
        overflow-x: auto;
    }

    .evolution-tree {
        min-width: 600px; /* Impede esmagamento dos nodes */
        justify-content: center;
    }
    /* botão fechar */
    .close-btn2{
        display: none;
    }
    /* --- ÁRVORE DE EVOLUÇÃO (Slider Horizontal) --- */
    .evolution-container {
        position: relative;
        width: 100%;
        bottom: 0;
        margin-top: auto;
        background: linear-gradient(180deg, rgba(175, 125, 90, 0.2) 0%, rgba(175, 125, 90, 0.8) 100%);
        padding: 20px 15px !important;
        
        /* Configurações do Slider */
        overflow-x: auto !important;
        scroll-snap-type: x mandatory; /* Faz o scroll "travar" nos itens */
        -webkit-overflow-scrolling: touch; /* Scroll suave no iOS */
        scrollbar-width: none; /* Esconde scrollbar no Firefox */
    }

    .evolution-container::-webkit-scrollbar {
        display: none; /* Esconde scrollbar no Chrome/Safari */
    }

    /* Força TODOS os containers da árvore a ficarem em linha horizontal */
    .evolution-tree, .branches, .branch-row {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 15px !important;
        width: max-content !important; /* Permite que cresça para fora da tela (ativando o scroll) */
        margin: 0 !important;
    }

    /* Impede que os cartões esmaguem e aplica o snap do slider */
    .base-node, .evo-item {
        flex: 0 0 auto !important;
        scroll-snap-align: start; /* Ponto de parada do scroll */
        min-width: 190px !important; /* Ajuste o tamanho da caixinha se precisar */
        margin: 0 !important;
    }

    /* Oculta as linhas verticais/horizontais de conexão do PC, pois no mobile não combinam com o slider */
    .branches::before, 
    .branch-row::before, 
    .base-node::after, 
    .branch-row .evo-item:not(:first-child)::before {
        display: none !important;
    }

}