* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f4f7fc;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 900px;
    width: 100%;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 30px;
    text-align: center;
}

h1 {
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2rem;
}

.flags-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
    margin: 0 auto;
}

.flag {
    font-size: 3rem;
    padding: 15px 15px 35px 15px;
    border-radius: 8px;
    background-color: #f1f5f9;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    position: relative;
}

.flag-emoji {
    font-size: 3rem;
    margin-bottom: 10px;
}

.flag:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background-color: #e6eef7;
}

.flag:active {
    transform: scale(0.95);
}

.flag .tooltip {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
}

.flag:hover .tooltip {
    opacity: 1;
}

.click-counter {
    font-size: 1rem;
    font-weight: bold;
    color: #2c3e50;
    position: absolute;
    bottom: 10px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    padding: 2px 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

@media (max-width: 600px) {
    .flags-container {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 10px;
    }
    
    .flag {
        font-size: 2rem;
        padding: 10px 10px 30px 10px;
    }
    
    .flag-emoji {
        font-size: 2rem;
        margin-bottom: 8px;
    }
    
    .click-counter {
        font-size: 0.8rem;
        bottom: 8px;
    }
}