html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden; 
}

body {
    background-color: #c0c0c0; 
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none; 
    box-sizing: border-box;
}

.body-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 5px;
    box-sizing: border-box;
}

.game-container {
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    padding: 5px;
    background-color: #c0c0c0;
    display: flex; 
    flex-direction: column; 
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    align-items: center;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
    border: 2px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    margin-bottom: 5px;
    flex-shrink: 0;
    width: 100%; 
    box-sizing: border-box; 
}

.counter {
    background-color: #000000;
    color: #ff0000;
    font-family: 'Courier New', Courier, monospace;
    font-size: 24px;
    padding: 2px 4px;
    border: 1px solid #808080;
    width: 50px;
    text-align: center;
}

.smiley {
    width: 30px;
    height: 30px;
    font-size: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    cursor: pointer;
    background-color: #c0c0c0;
    flex-shrink: 0;
}

.smiley:active {
    border-color: #808080 #ffffff #ffffff #808080;
}

.grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    border: 2px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    aspect-ratio: 1 / 1; 
    flex-grow: 1; 
    min-height: 0; 

}

.cell {
    width: 100%;
    height: 100%;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    background-color: #c0c0c0;
    text-align: center;
    line-height: normal; 
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cell.revealed {
    border: 1px solid #808080;
    background-color: #c0c0c0;
}


.cell.c1 { color: #0000ff; }
.cell.c2 { color: #008000; }
.cell.c3 { color: #ff0000; }
.cell.c4 { color: #000080; }
.cell.c5 { color: #800000; }
.cell.c6 { color: #008080; }
.cell.c7 { color: #000000; }
.cell.c8 { color: #808080; }

.cell.mine {
    background-color: red;
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .game-container {
        width: 100%;
        height: 100%;
        padding: 1vw;
    }

    .header {
        padding: 1.5vw;
        margin-bottom: 1.5vw;
    }

    .counter {
        font-size: 5vw;
        width: auto;
        padding: 1vw 2vw;
        flex: 1;
        text-align: center;
    }

    .smiley {
        width: 10vw;
        height: 10vw;
        font-size: 7vw;
        flex-shrink: 0;
    }

    .cell {
        font-size: 4.5vw;
    }
}
