body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
    touch-action: manipulation; /* タッチ操作の遅延防止 */
}

#container {
    text-align: center;
    background-color: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    max-width: 600px;
    width: 95%;
}

h1 {
    color: #333;
    font-size: 24px;
    margin: 10px 0;
}

#mode-selection {
    margin-bottom: 15px;
}

#mode-selection button {
    margin: 5px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    touch-action: manipulation;
}

#mode-selection button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#game-area {
    margin-top: 15px;
}

#holes {
    display: grid;
    grid-template-columns: repeat(5, 80px);
    grid-template-rows: repeat(4, 80px);
    gap: 5px;
    justify-content: center;
    margin: 15px auto;
}

.hole {
    width: 80px;
    height: 80px;
    background-color: #8B4513;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
}

.mole {
    width: 80px;
    height: 80px;
    position: absolute;
    bottom: 0;
    left: 0;
    font-size: 60px;
    line-height: 80px;
    text-align: center;
    cursor: pointer;
    touch-action: manipulation;
}

.mole.hazard {
    background-color: rgba(255, 0, 0, 0.2);
}

#status {
    margin-bottom: 15px;
    font-size: 14px;
}

#status p {
    margin: 5px 0;
}

#start-button, #back-button, #retry-button, #back-to-menu {
    padding: 8px 16px;
    font-size: 14px;
    margin: 5px;
    cursor: pointer;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    touch-action: manipulation;
}

#result {
    margin-top: 15px;
}

@media (max-width: 480px) {
    #container {
        padding: 10px;
        width: 100%;
    }

    h1 {
        font-size: 20px;
    }

    #mode-selection button {
        padding: 6px 12px;
        font-size: 12px;
    }

    #holes {
        grid-template-columns: repeat(5, 60px);
        grid-template-rows: repeat(4, 60px);
        gap: 4px;
    }

    .hole {
        width: 60px;
        height: 60px;
    }

    .mole {
        width: 60px;
        height: 60px;
        font-size: 45px;
        line-height: 60px;
    }

    #status {
        font-size: 12px;
    }

    #start-button, #back-button, #retry-button, #back-to-menu {
        padding: 6px 12px;
        font-size: 12px;
    }
}