*, *::before, *::after {
    box-sizing: border-box;
}
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}
body { 
    font-family: Arial, sans-serif; 
    background-color: #f0f2f5; 
    color: #333; 
    display: flex;
}
.main-content {
    flex-grow: 1;
    width: calc(100% - 300px);
    height: 100vh;
    position: relative;
}
.right-sidebar {
    width: 300px;
    background-color: #fff;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100vh;
    overflow-y: auto;
    padding-bottom: 80px;
}
.header {
    text-align: center;
    margin-bottom: 20px;
}
.header img {
    max-width: 150px;
}
.tabs {
    display: flex;
    margin-bottom: 15px;
}
.tab-button {
    flex: 1 1 auto;
    padding: 12px;
    font-size: 16px;
    white-space: nowrap;
    border-radius: 3px 30px 0px 0px;
    background-color: #e9ecef;
    color: #333;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}
.tab-button img {
    width: 16px;
    height: 16px;
    margin-right: 5px;
    vertical-align: middle;
}
/* Individualização das cores das abas ativas */
.tab-button.active {
    filter: brightness(1.2);
    color: #fff;
}
.tab-button.active.adivinhar-btn {
    background-color: #007bff;
}
.tab-button.active.categorias-btn {
    background-color: #fd7e14;
}
.tab-button.active.desenhar-btn {
    background-color: #28a745;
    color: #fff;
}
.tab-button:hover {
    filter: brightness(1.1);
}
.tab-content {
    display: none;
    flex-grow: 1;
}
.tab-content.active {
    display: block;
    display: flex;
    flex-direction: column;
}
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-grow: 1;
}
.form-group {
    display: flex;
    flex-direction: column;
}
.form-group label {
    margin-bottom: 5px;
    font-weight: bold;
}
.form-row {
    display:  flex;
    gap: 10px;
}
.form-small {
    width: 30%;
}
.form-large {
    width: 70%;
}
select, input[type="text"], input[type="number"] {
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}
input[type="number"] {
    width: 60px;
}
/* Estilos para os botões gerais */
.submit-button, .limpar-btn, .sugerir-btn, .fechar-btn {
    padding: 10px 15px;
    font-size: 16px;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, filter 0.3s;
}
.submit-button { background-color: #007bff; }
.limpar-btn {
    background-color: #6c757d;
    padding: 5px 10px;
    font-size: 12px;
}
.sugerir-btn { background-color: #28a745; }
.fechar-btn { background-color: #dc3545; }
.submit-button:hover { background-color: #0056b3; }
.limpar-btn:hover { background-color: #5a6268; }
.sugerir-btn:hover { background-color: #218838; }
.fechar-btn:hover { background-color: #c82333; }
.resultados-container {
    flex-grow: 1;
    margin-top: 20px;
    padding: 15px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow-y: auto;
    margin-bottom: 80px;
    max-height: 400px;
}
.resultados-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.resultados-container img {
    max-width: 100%;
    margin: 10px 0;
    border-radius: 4px;
}
.footer {
    position: fixed;
    bottom: 0;
    left: calc(100% - 300px);
    width: 300px;
    padding: 10px;
    border-top: 1px solid #ccc;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    z-index: 100;
}
.footer .social-icons img {
    width: 24px;
    margin: 0 5px;
}
.form-sugestao {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    z-index: 1000;
}
.form-sugestao.visible {
    display: block;
}
/* Novos estilos para a lista de categorias */
.lista-categorias {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    list-style: none;
    padding: 0;
}
.lista-categorias li {
    font-size: 11.5px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 1px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Estilo do botão de tela cheia */
.fullscreen-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    z-index: 10;
}

.fullscreen-button:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Estilo do container em tela cheia */
#game-container:-webkit-full-screen {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}
#game-container:-moz-full-screen {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}
#game-container:-ms-fullscreen {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}
#game-container:fullscreen {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}
#game-container:fullscreen .fullscreen-button {
    display: none;
}


/* --- Mágica para dispositivos móveis e tablets --- */
@media (max-width: 768px) {
    body {
        flex-direction: column;
        height: auto;
        overflow-y: auto;
    }
    .main-content {
        display: none;
    }
    .right-sidebar {
        width: 100%;
        padding: 10px;
        box-shadow: none;
        height: auto;
        overflow-y: auto;
    }
    .header img {
        max-width: 100px;
    }
    .tabs {
        flex-wrap: wrap;
        overflow-x: auto;
    }
    .tab-button {
        flex: 1 1 auto;
        padding: 12px;
        font-size: 16px;
        white-space: nowrap;
    }
    .form-row {
        flex-direction: row;
        gap: 10px;
        flex-wrap: wrap;
    }
    .form-small, .form-large {
        flex-grow: 1;
        width: auto;
    }
    .form-small {
        min-width: 80px; /* Largura mínima para o Q.Letras */
    }
    .form-group {
        margin-bottom: 10px;
    }
    select, input[type="text"], input[type="number"] {
        width: 100%;
        box-sizing: border-box;
    }
    .resultados-container {
        max-height: 50vh;
        margin-bottom: 10px;
    }
    .footer {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
    }
}