* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #2c221e;
    background-image: url('./img/a_table_featuring.jpg');
    background-size: cover;
    color: #fdfbf7;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

main{
    width: 100%;
}

.galeria {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    width: 100%;
    max-height: 500px; /* altura limite*/
    overflow-x: hidden;
    overflow-y: auto; 
}

.item {
    background-color: #fb8500;
    color: #fff;
    border: none;
    padding: 5px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    align-items: center;
    text-align: center;
}

.item img {
    width: 80px;
    height: 80px;
    display: block;
    margin: 0 auto 10px;
}



#game-play {
    display: none;
}

.ui-header {
    text-align: center;
    margin-bottom: 15px;
}

.ui-header h1 {
    font-size: 1.8rem;
    color: #ffb703;
    margin-bottom: 8px;
}

#stats-panel {
    display: flex;
    gap: 20px;
    font-size: 1.1rem;
    font-weight: bold;

    /* Permite que os itens quebrem para a linha de baixo */
    flex-wrap: wrap;
    
    /* Opcional: Centraliza os botões quando eles quebrarem de linha */
    justify-content: center;
}




#canvas-container {
    position: relative;
    border: 4px solid #c3b971;
    border-radius: 8px;
    overflow: hidden;
    background-color: #c3b971;
}

canvas {
    display: block;
    width: 100%;
    height: auto;
    max-width: 580px;
    /*min-width: 180px;*/
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #5e2d0f;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: 600px;  
    /*min-width: 200px;*/
}

/* Regra para telas de 300px ou menos */
@media (max-width: 300px) {
    .game-container {
        padding: 0;
        margin: 0;
        min-width: 0; /* Permite que o container encolha abaixo de 200px */
        border-radius: 0; /* Opcional: remove o arredondamento para ocupar 100% dos cantos */
    }
    #ui-footer {
        gap: 10px;
        margin-top: 2px;
    }
}

#ui-footer {
    display: flex;
    gap: 15px;
    margin-top: 15px;

    /* Permite que os itens quebrem para a linha de baixo */
    flex-wrap: wrap;
    
    /* Opcional: Centraliza os botões quando eles quebrarem de linha */
    justify-content: center;
}

.game-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.game-modal.hidden {
    display: none;
}

.game-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
}

.game-modal__content {
    position: relative;
    background: rgba(255, 255, 255, 0.96);
    color: #2c221e;
    padding: 24px 28px;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
    min-width: 280px;
    max-width: 420px;
    text-align: center;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.game-modal__image {
    display: block;
    width: 110px;
    height: 110px;
    object-fit: contain;
    margin: 0 auto 16px;
    border-radius: 12px;
}

.game-modal__content p {
    margin-bottom: 20px;
    font-size: 1rem;
    line-height: 1.5;
    max-width: 100%;
}

.game-modal__content .game-btn {
    min-width: 120px;
}

.game-btn-container{
    background-color: #502000;
    padding: 8px;
    border-radius: 6px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.game-btn {
    background-color: #fb8500;
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.game-btn:hover {
    background-color: #ffb703;
}

.game-btn:active {
    transform: scale(0.95);
}