body {
    margin: 0;
    background-image: url('img/estrutura/AREIAESCURA.png');
    background-repeat: repeat;
    background-size: 200px 200px;
    --largura-peca: 666px;
    --largura-maxima: 4;
    --altura-maxima: 2;

}

.peca.selecionada {
    box-shadow: 0 0 25px yellow, 0 0 10px yellow inset;
    transform: scale(1.05);
    z-index: 1500 !important;
}


/* ================================
   SIDEBAR E MENUS
   ================================ */
.input-load {
    display: none; /* Esconde o input de arquivo padrão */
}
.btn-load-label {
    /* Estilize como um botão */
    background-color: #4CAF50;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-family: sans-serif;
    font-size: 14px;
}
.btn-load-label:hover {
    background-color: #45a049;
}


#painel-cartas {
    position: fixed;
    bottom: 20px;
    left: 50px;
    width: 790px;
    height: 490px;
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
    cursor: move;
    z-index: 998;
    transform: translateX(calc(-100% - 50px));
    transition: transform 0.4s ease-in-out;
    overflow: hidden; /* Adicionado para conter o iframe escalado */
}

#painel-cartas.visible {
    transform: translateX(0);
}

.cartas-frame {
    width: 1500px;  /* (900px / 0.6) */
    height: 1167px; /* (700px / 0.6) */
    border: none;
    transform: scale(0.6);
    transform-origin: top left;
}

/* Media queries movidas para mobile-compatibility.js */

#toggle-cartas-btn {
    position: fixed;
    bottom: 400px;
    left: 10px;
    z-index: 999;
    width: 46px;
    height: 77px;
    padding: 0;
    background: none;
    border: 2px solid #ffce00;
    border-radius: 5px;
    cursor: pointer;
    overflow: hidden;
}

#toggle-cartas-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#toggle-cartas-btn:hover {
    transform: scale(1);
}

.sidebar {
    position: fixed;
    right: -250px;
    top: 0;
    width: 250px;
    height: 100%;
    background: #23272b;
    color: #fff;
    padding: 30px 20px;
    box-shadow: -2px 0 8px rgba(0,0,0,0.1);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 15px; 
    transition: right 0.3s;
    box-sizing: border-box; 
    overflow-y: auto; 
}

.sidebar.active {
    right: 0; 
}

.sidebar h3 {
    margin: 0 0 10px 0;
    color: #ffce00;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
}

.sidebar select, .sidebar button {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: none;
    font-size: 14px;
    box-sizing: border-box;
}

.sidebar button {
    background-color: #ffce00;
    color: #23272b;
    cursor: pointer;
}

.menu-section {
    border-bottom: 1px solid #444;
    padding-bottom: 15px;
}

.checkbox-container {
    display: block;
    margin-bottom: 8px;
}

.checkbox-container label {
    cursor: pointer;
    margin-left: 5px;
}

.toggle-sidebar-btn {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 200;
    background: #ffce00;
    color: #23272b;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 24px;
    width: 50px;
    height: 50px;
    padding: 0;
    line-height: 50px;
    text-align: center;
}

#toggle-save-sidebar-btn {
    top: 75px;
}


#peca-palette {
    position: fixed;
    top: 0;
    left: 90px;
    right: 90px;
    width: auto;
    background-color: rgba(35, 39, 43, 0.95);
    padding: 10px 0 10px 20px;
    box-sizing: border-box;
    z-index: 90;
    display: flex;
    flex-direction: row;
    align-items: center;
    border-bottom: 2px solid #ffce00;
    gap: 0;
}

.palette-scroll-btn {
    background: rgba(30,30,30,0.8);
    border: none;
    color: #ffce00;
    font-size: 32px;
    width: 48px;
    height: 80px;
    cursor: pointer;
    z-index: 91;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0 8px;
    border-radius: 8px;
    user-select: none;
}
.palette-scroll-btn.left {
    margin-left: 0;
    margin-right: 12px;
}
.palette-scroll-btn.right {
    margin-right: 20px;
    margin-left: 12px;
}
.palette-scroll-btn:active {
    background: #ffce00;
    color: #222;
}

.palette-scroll-area {
    overflow-x: auto;
    overflow-y: visible;
    flex: 1 1 auto;
    display: flex;
    flex-direction: row;
    gap: 30px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.palette-scroll-area::-webkit-scrollbar {
    display: none;
}

.palette-section h3 {
    margin: 0 0 10px 0;
    color: #ffce00;
    font-size: 16px;
}

.palette-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow: visible;
}

.palette-spawner {
    width: 60px;
    height: 60px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: grab;
    border: 1px solid #555;
    border-radius: 4px;
}

.palette-spawner:active {
    cursor: grabbing;
}

/* Adicione este estilo ao seu arquivo .css */

.palette-spawner {
    position: relative; /* Necessário para posicionar o contador dentro dele */
    display: flex;
    align-items: center;
    justify-content: center;
}

.palette-counter {
    position: absolute;
    bottom: 2px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 16px;
    font-weight: bold;
    padding: 1px 5px;
    border-radius: 5px;
    pointer-events: none; /* Garante que o contador não interfira no clique */
}

/* ================================
   TABULEIRO E PEÇAS
   ================================ */

#tabuleiro {
    width: calc(var(--largura-peca) * var(--largura-maxima));
    height: calc(var(--largura-peca) * var(--altura-maxima));
    margin-left: 1000px;
    margin-top: 150px;
  
    background-repeat: no-repeat;
    background-size: calc(var(--largura-peca) * var(--largura-maxima)) calc(var(--largura-peca) * var(--altura-maxima));
}

.peca {
    position: relative; 
    width: 100px;
    height: 100px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.botao-interativo {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 8px;
    font-size: 10px;
    cursor: pointer;
    z-index: 501;
}
.tam-elite { width: 120px; height: 120px; }
.tam-boss { width: 200px; height: 200px; }
.tam-carro { width: 200px; height: 250px; }
.tam-objetivo { width: 70px; height: 70px; }
.tam-torre { width: 270px ; height: 270px; z-index: 20;}
.tam-gira { width: 200px ; height: 200px; z-index: 15;}
.tam-arame_farpado { width: 100px ; height: 120px; z-index: 20;}
/* =============================================
                        FICHAS
   ============================================= */
.peca.fichas {
    width: 1240px !important;
    height: 710px;
    background-size: auto;
}



#card-deck-area {
    position: relative;
    height: 1335px;
    width: 7000px;
    background-color: rgba(0, 0, 0, 0.2); 
    border-bottom: 2px dashed #ffce00; 
    margin-bottom: 20px; 

}

#folga_bot {
    position: relative;
    height: 500px;
    width: 100%;
    border-bottom: 2px dashed #ffce00; 
    margin-bottom: 20px; 

}

#character-sheets-area {
    position: relative;
    height: 1000px;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 2px dashed #ffce00;
}
/* ================================================
   BOTÕES PARA PEÇAS GIRATÓRIAS
   ================================================ */
.botao-girar {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background-color: rgba(255, 206, 0, 0.8);
    color: #23272b;
    border: 1px solid white;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    line-height: 28px;
    z-index: 502;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.botao-girar:hover {
    background-color: #ffce00;
}

.botao-girar-esquerda {
    left: -35px;
}

.botao-girar-direita {
    right: -35px;
}

.peca-wrapper {
    position: relative; 
    border: none;
    background-color: transparent;
}

.girapeças-visual {
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease-in-out;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* ===================================================================

/*
 ================================================
   PAINEL DE DADOS RETRÁTIL
 ================================================ 
*/
#toggle-duvidas-btn {
    position: fixed;
    top: 120px;
    left: 10px;
    margin-top: 140px;
    z-index: 810; 
    background-color: #ffce00;
    color: #23272b;
    border: 2px solid white;
    border-radius: 5px;
    padding: 10px 15px;
    cursor: pointer;
    width: 40px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

#toggle-duvidas-btn img {
    width: 20px;
    height: 20px;
}

#painel-duvidas {
    position: fixed;
    top: 110px;
    left: 50px;
    width: 900px; 
    height: 700px; 
    background-color: rgba(0, 0, 0, 0.6);
    padding: 20px;
    border-radius: 0 10px 10px 0;
    border: none;
    z-index: 805; 
    cursor: move; 
    transform: translateX(calc(-100% - 50px));
    transition: transform 0.4s ease-in-out;
}

#painel-duvidas.aberto {
    transform: translateX(0);
}

.duvidas-frame {
    width: 900px;
    height: 700px;
    border: none;
    transform: scale(1); 
    transform-origin: top left;
    display: block; 
}


#toggle-missoes-btn {
    position: fixed;
    top: 110px;
    left: 10px;
    margin-top: 70px;
    z-index: 810; 
    background-color: #ffce00;
    color: #23272b;
    border: 2px solid white;
    border-radius: 5px;
    padding: 10px 15px;
    cursor: pointer;
    width: 40px;
    text-align: center;
    font-size: 11px;
    font-weight: bold;
    writing-mode: vertical-rl; 
    text-orientation: mixed;
}

#painel-missoes {
    position: fixed;
    top: 110px;
    left: 50px;
    width: 900px; 
    height: 700px; 
    background-color: rgba(0, 0, 0, 0.6);
    padding: 20px;
    border-radius: 0 10px 10px 0;
    border: none;
    z-index: 805; 
    cursor: move; 
    transform: translateX(calc(-100% - 50px));
    transition: transform 0.4s ease-in-out;
}

#painel-missoes.aberto {
    transform: translateX(0);
}

.missoes-frame {
    width: 900px;
    height: 700px;
    border: none;
    transform: scale(1); 
    transform-origin: top left;
    display: block; 
}

/* ================================================
   PAINEL DE DADOS
   ================================================ */

#toggle-dados-btn {
    position: fixed;
    top: 110px;
    left: 10px;
    z-index: 850; 
    background-color: #ffce00;
    color: #23272b;
    border: 2px solid white;
    border-radius: 5px;
    padding: 10px 15px;
    cursor: pointer;
    width: 40px;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    writing-mode: vertical-rl; 
    text-orientation: mixed;
}


#painel-dados {
    position: fixed;
    top: 110px;
    left: 50px;
    width: 900px; 
    height: 350px; 
    background-color: rgba(0, 0, 0, 0.6);
    padding: 20px;
    border-radius: 0 10px 10px 0;
    border: none;
    z-index: 820; 
    cursor: move; 
    transform: translateX(calc(-100% - 50px));
    transition: transform 0.4s ease-in-out;
}
#painel-dados.aberto {
    transform: translateX(0);
}


.dados-frame {
    width: 1500px;
    height: 600px;
    border: none;
    transform: scale(0.6); 
    transform-origin: top left;
    display: block; 
}

.palette-action-button {
    
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    background-color: #e74c3c;
    color: white;
    height: fit-content; /* Ajusta a altura ao conteúdo */
}

.palette-action-button:hover {
    background-color: #c0392b;
}

/* ================================================
   ESTILOS PARA FILTRO DE PEÇAS NA PALETA
   ================================================ */

.title-with-filters {
    display: flex;
    align-items: center; /* Alinha o título e a caixa de filtros na vertical */
    gap: 20px;         /* Cria um espaço entre o título e os filtros */
}

#filtro-temporada-container .checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;        /* Espaço entre cada checkbox (ex: T1 e T2) */
}

#filtro-temporada-container label {
    color: #fff;      /* Cor da legenda (T1, T2, etc.) */
    font-size: 14px;
    font-weight: normal;
    cursor: pointer;
    padding-left: 3px; /* Pequeno espaço entre a caixa e o texto */
}

#filtro-temporada-container input[type="checkbox"] {
    cursor: pointer;
    /* Opcional: Aumentar um pouco a caixa de seleção */
    transform: scale(1.1); 
}

/* Prepara o ícone da paleta para posicionar o indicador */
.palette-spawner {
    position: relative;
}

/* Estilo e posição do indicador de atalho */
.shortcut-indicator {
    position: absolute;
    top: 2px;
    left: 2px;
    background-color: rgba(0, 0, 0, 0.75);
    color: white;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    font-family: sans-serif;
    
    /* Centraliza o texto */
    display: flex;
    align-items: center;
    justify-content: center;

    /* Impede que o indicador bloqueie cliques */
    pointer-events: none;

    /* Começa invisível e com animação suave */
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

/* ================================================
   SISTEMA DE BARALHOS E CONTROLES (VERSÃO FINAL LIMPA)
   ================================================ */
#deck-wrapper-deck_molotov .deck-pile {
    background-image: url('img/cartas/molotov_back9.png');
}

#deck-wrapper-deck_ferimento .deck-pile {
    background-image: url('img/cartas/ferimento_back.png');
}
/* --- 1. POSICIONAMENTO DOS CONTÊINERES DE CADA BARALHO --- */
.deck-wrapper {
    position: absolute;
}
#deck-wrapper-deck_artefatos {
    top: 150px;
    left: 200px;
}
#deck-wrapper-deck_PIMP {
    top: 150px;
    left: 800px;
}
#deck-wrapper-deck_inicial {
    top: 150px;
    left: 1400px;
}

#deck-wrapper-deck_molotov {
    top: 150px;
    left: 2000px; /* Dando continuidade ao espaçamento de 600px */
}

#deck-wrapper-deck_ferimento {
    top: 150px;
    left: 2600px; /* Posicionado após o de Molotov */
}



/* --- 2. LAYOUT DAS PILHAS DE COMPRA E DESCARTE --- */
.piles-container {
    display: flex;
    gap: 0;
}
.deck-pile, .deck-discard-pile {
    width: 234px;
    height: 354px;
    transform: scale(0.65);
    transform-origin: top left;
    border: 3px solid #7a5e0b;
    border-radius: 8px;
    cursor: pointer;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
.deck-pile.empty {
    opacity: 0.5;
    cursor: not-allowed;
}
.deck-discard-pile {
    border-style: dashed;
    margin-left: -50px;
}

#deck-wrapper-deck_artefatos .deck-pile,
#deck-wrapper-deck_PIMP .deck-pile {
    background-image: url('img/cartas/equipamentos-back.png');
}
#deck-wrapper-deck_inicial .deck-pile {
    background-image: url('img/cartas/back deck inicial.jpg');
}

.artifact-wrapper {
    position: absolute;
    user-select: none;
    z-index: 500;
    
    cursor: move;
    transform: scale(0.65);
    transform-origin: top left;
}
.artifact-card {
    width: 234px;
    height: 354px;
    background-repeat: no-repeat;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}
.artifact-card.zoomed {
    transform: scale(1.5);
    z-index: 9999;
}
.discard-button {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 20px;
    height: 20px;
    background: #e74c3c;
    color: white;
    border: 1px solid white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    line-height: 18px;
    text-align: center;
    z-index: 600;
}



/* Nova classe para botões de reset com posicionamento absoluto */
.botao-resetar-absoluto {
    position: absolute; /* Essencial para controle total de top/left */
    z-index: 600; /* Garante que o botão fique acima dos baralhos */
    padding: 5px 10px;
    background-color: #3498db; /* Cor de fundo azul */
    color: white;
    border: 1px solid white;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    width: 100px; /* Largura fixa para os botões */
    text-align: center; /* Centraliza o texto */
}

.player-selector {
    display: flex;
    gap: 5px;
    background-color: rgba(0,0,0,0.7);
    border-radius: 5px;
    padding: 3px;
    color: white;
    font-size: 10px;
    font-weight: bold;
}



/* Posicionamento individual de cada botão */
#reset-button-deck_artefatos {
    top: 122px; /* Ajuste este valor para a posição Y desejada */
    left: 200px; /* Ajuste este valor para a posição X desejada */
}

#reset-button-deck_PIMP {
    top: 122px; /* Ajuste este valor para a posição Y desejada */
    left: 800px; /* Ajuste este valor para a posição X desejada */
}

#reset-button-deck_inicial {
    top: 122px; /* Ajuste este valor para a posição Y desejada */
    left: 1400px; /* Ajuste este valor para a posição X desejada */
}

#seletor-baralho-inicial {
    position: absolute;
    top: 110px;
    left: 1500px;
    background-color: #23272b;
    color: #ffce00;
    border: 1px solid white;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 600;
}
#seletor-baralho-inicial label {
    margin: 0;
}
#seletor-baralho-inicial select {
    padding: 2px;
    border-radius: 3px;
    font-size: 11px;
}
    /* ================================================
   PAINEL DE COMPRA DE CARTA ESPECÍFICA (VERSÃO MESA)
   ================================================ */

#seletor-carta-especifica {
    position: absolute;
    top: 10px;        
    left: 1000px;      
    /* width: 250px;  <- REMOVIDO para o menu se ajustar ao conteúdo */
    display: inline-block; /* ADICIONADO para o menu se ajustar ao conteúdo */
    background-color: #23272b;
    border: 2px solid #ffce00;
    border-radius: 8px;
    padding: 15px;
    box-sizing: border-box;
    z-index: 700;
    color: white;
}

#seletor-carta-especifica h3 {
    margin: 0 0 15px 0;
    color: #ffce00;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
    text-align: center;
    font-size: 16px; 
}

.botoes-selecao-temporada {
    display: flex;
    /* justify-content: space-between; <- ALTERADO para 'center' */
    justify-content: center; /* ADICIONADO para centralizar os botões menores */
    gap: 10px; /* AUMENTADO o espaçamento para um visual melhor */
    margin-bottom: 15px;
}

.botoes-selecao-temporada button {
    /* flex-grow: 1; <- REMOVIDO para impedir que os botões cresçam */
    padding: 6px 15px; /* AJUSTADO para botões menores e mais proporcionais */
    background-color: #ffce00;
    color: #23272b;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

/* O restante do seu código permanece igual */
.lista-cartas {
    max-height: 400px;
    overflow-y: auto;
    background-color: rgba(0,0,0,0.3);
    border-radius: 4px;
}

.item-carta-selecao {
    padding: 10px;
    border-bottom: 1px solid #444;
    cursor: pointer;
    font-family: monospace;
    font-size: 14px;
}

.item-carta-selecao:hover {
    background-color: #ffce00;
    color: #23272b;
}

.item-carta-selecao:last-child {
    border-bottom: none;
}

/* Regra final: torna os indicadores visíveis quando o 'interruptor' (Alt) está ligado */
.mostrando-atalhos .shortcut-indicator {
    opacity: 1;
}


/* Regras mobile movidas para mobile-compatibility.js */


/* ================================================
   GERENCIAMENTO DE CAMADAS (Z-INDEX)
   ================================================ */
/* --- Camadas de Base --- */
#card-deck-area {
    z-index: 2; 
}
#game-pieces-area {
    z-index: 3;
}

/* --- Hierarquia dos Itens de Jogo --- */

.peca.fichas {
    transform: scale(0.7);
    z-index: 10;     /* FICHA: Camada mais baixa. */
}

#artifact-deck-pile {
    z-index: 15;
}

.artifact-wrapper {
    z-index: 25;     /* CARTA COMPRADA: Acima da Ficha. */
}

.peca {
    z-index: 20;     /* PEÇAS (Carro, Zumbi): Acima de tudo, na camada mais alta do jogo. */
}

/* --- Demais Elementos --- */
.botao-interativo {
    z-index: 30;
}
.artifact-footer {
    z-index: 35; 
}

/* --- Camadas de Interface Principal (por cima de tudo) --- */
#area-jogo-zumbi {
    z-index: 800;
}
#painel-dados {
    z-index: 805;
}
#toggle-dados-btn {
    z-index: 810;
}
#peca-palette {
    z-index: 850;
}
.sidebar {
    z-index: 900;
}
.toggle-sidebar-btn {
    z-index: 920;
}

/* --- Camadas de Ação (A mais alta de todas) --- */
.artifact-card.zoomed {
    z-index: 1000; 
}
.peca.arrastando {
    z-index: 1999; 
}
.tam-elite { width: 120px; height: 120px; }
.tam-boss { width: 200px; height: 200px; }
.tam-carro { width: 200px; height: 250px; }
.tam-objetivo { width: 70px; height: 70px; }
.tam-torre { width: 270px ; height: 270px; z-index: 15;}
.tam-gira { width: 200px ; height: 200px; z-index: 15;}
.tam-arame_farpado { width: 100px ; height: 120px; z-index: 20;}
.tam-porta_cela { width: 50px; height: 60px; }