body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #111;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
    justify-content: center;
}

#menu {
    text-align: center;
    margin-top: 10px;
}

#menu h1 {
    font-family: 'Arial', sans-serif;
    font-size: 23px; /* Font size */
    font-weight: bold; /* Make the font bold */
    color: rgb(255, 140, 0);
    text-align: center;
    text-shadow: 3px 3px 5px rgba(0,0,0,0.3); /* Optional shadow */
    letter-spacing: 1px; /* Space between letters */
    padding: 10px;
} 

#menu h2 {
    font-family: 'Arial', sans-serif;
    font-size: 15px; /* Font size */
    font-weight: bold; /* Make the font bold */
    color: rgb(0, 238, 255);
    text-align: center;
    text-shadow: 3px 3px 5px rgba(0,0,0,0.3); /* Optional shadow */
    letter-spacing: 1px; /* Space between letters */
    padding: 10px;
}  

#country-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Tự động thay đổi số cột */
    gap: 10px 15px;
    justify-items: center;
    margin-top: 8px;
    width: 100%;
    padding: 0 10px;
}

#country-buttons button {
    margin: 5px;
    padding: 8px 12px;
    font-size: 16px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    background: #444;
    color: #fff;
    transition: 0.2s;
}

#country-buttons button:hover {
    background: #666;
}

#country-buttons button.conquered {
    background: #000;
    color: #555;
    cursor: default;
}

#game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 400px; /* Mobile First */
    margin-top: 20px;
    padding: 0 10px;
    box-sizing: border-box;
}

#trump-gif {
    display: block;
    margin: 0 auto 10px auto;
    width: 100%;
    max-width: 190px;
    object-fit: contain;
}

#game-canvas {
    width: 100%; /* Chiếm hết chiều rộng */
    height: auto;
    max-height: 70vh; /* Đảm bảo chiều cao tối đa là 70% chiều cao màn hình */
    background: #222;
    border: 2px solid #555;
}

#scoreboard {
    margin-top: 10px;
    font-size: 18px;
}

#keyboard {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.key-btn {
    margin: 3px;
    padding: 10px;
    font-size: 14px; /* Giảm kích thước phím trên màn hình nhỏ */
    border-radius: 5px;
    border: none;
    background: #555;
    color: #fff;
    cursor: pointer;
    transition: 0.2s;
}

.key-btn:hover {
    background: #777;
}

.key-btn:active {
    background: #0f0;
}

#exit-game {
    margin-top: 10px;
    padding: 6px 12px;
    font-size: 16px;
    border-radius: 5px;
    border: none;
    background: #900;
    color: #fff;
    cursor: pointer;
}

@media (max-width: 768px) {
    #country-buttons {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); /* Giảm kích thước nút */
    }
    
    #game-container {
        max-width: 100%;
        padding: 10px;
    }

    #scoreboard {
        font-size: 16px; /* Giảm font size cho nhỏ hơn trên màn hình di động */
    }

    .key-btn {
        font-size: 12px; /* Giảm kích thước phím trên di động */
        padding: 8px 10px;
    }

    #exit-game {
        font-size: 14px;
        padding: 4px 10px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px; /* Giảm kích thước chữ cho màn hình nhỏ */
    }

    #game-canvas {
        max-height: 60vh; /* Giảm chiều cao canvas trên màn hình nhỏ */
    }

    .key-btn {
        font-size: 10px; /* Giảm kích thước phím nhỏ hơn */
        padding: 6px 8px;
    }

    #exit-game {
        font-size: 12px;
        padding: 4px 8px;
    }
}
