body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    overflow: hidden;
}

.container {
    text-align: center;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    width: 80%;
    max-width: 600px;
}

h1 {
    color: #333;
    margin-bottom: 20px;
}

#game {
    display: grid;
    grid-template-columns: repeat(10, 40px);
    grid-gap: 2px;
    margin: 0 auto 20px;
    justify-content: center;
}

.hex {
    width: 40px;
    height: 46.4px;
    background-color: #ddd;
    position: relative;
    cursor: pointer;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    transition: background-color 0.2s, transform 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 0.8rem;
    color: #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hex:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.5);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    transition: background-color 0.2s;
    z-index: 1;
}

.hex.flagged:before {
    background-color: rgba(255, 140, 0, 0.8);
}

.hex.mine:before {
    background-color: rgba(255, 76, 76, 0.8);
}

.hex:hover:before {
    background-color: rgba(0, 0, 0, 0.05);
}

.hex:active {
    transform: scale(0.95);
}

.hex:nth-child(odd) {
    background-color: #b3cde0;
}

.hex:nth-child(even) {
    background-color: #6497b1;
}

.info {
    margin: 20px 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
}

.info p {
    margin: 10px;
}

button {
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    background-color: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 4px;
    transition: background-color 0.3s;
    margin: 20px auto;
}

button:hover {
    background-color: #45a049;
}

.popup {
    display: none;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.popup-content {
    background-color: #fff;
    color: #333;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.popup-content p {
    margin-bottom: 20px;
}

.popup-content button {
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    background-color: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.popup-content button:hover {
    background-color: #45a049;
}

@media (max-width: 500px) {
    #game {
        grid-template-columns: repeat(5, 40px);
    }
}
