body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', sans-serif;
    background-color: #ddd;
    overflow-y: scroll;
}

body.scroll-disabled {
    touch-action: none;
    -webkit-overflow-scrolling: none;
    overflow: hidden;
    overscroll-behavior: none;
}


/*
 * Search Panel
 */

.search-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 0;
}

.search-panel input {
    -webkit-appearance: none;
    background-color: #fff;
    resize: none;
    font: inherit;
    padding: 12px 16px;
    border-radius: 6px;
    width: 320px;
    border: 1px solid #d9d9d9;
    outline: none;
    transition: box-shadow .2s;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .3);
}

.search-panel input:focus {
    outline: none;
    border-color: #0780ff;
    box-shadow: 0 0 6px rgba(7, 128, 255, 1), 0 8px 24px rgba(0, 0, 0, .3);
}



/*
 * Flags Grid
 */

.flags {
    display: grid;
    margin: 120px 0;
    grid-template-columns: repeat(5, 1fr);
}

@media only screen and (max-width: 600px) {
    .flags {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media only screen and (max-width: 400px) {
    .flags {
        grid-template-columns: repeat(2, 1fr);
    }
}

/*
 * Flags Grid Items
 */

.flags>div {
    justify-self: center;
    height: 16vw;
}

@media only screen and (max-width: 600px) {
    .flags>div {
        height: 25vw;
    }
}

@media only screen and (max-width: 400px) {
    .flags>div {
        height: 38vw;
    }
}

/*
 * Flag Container
 */

.flag-container {
    height: 45%;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/*
 * Flag
 */

.flag {
    height: 100%;
    margin-left: auto;
    margin-right: auto;
    display: block;
    cursor: pointer;
}

/*
 * Country Name
 */

.country-name {
    display: block;
    text-align: center;
    margin: 6px 4px 0;
    color: #000;
    line-height: 1.1;
    font-size: 16px;
}

@media only screen and (max-width: 980px) {
    .country-name {
        font-size: 14px;
    }
}

/*
 * Modal
 */

.modal {
    cursor: pointer;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 4vw;
    background-color: rgba(0, 0, 0, 0);
    transition: background-color .2s;
}

.modal.open {
    background-color: rgba(30, 30, 30, .96);
    transition: background-color .5s;
}

/*
 * Flag In Modal
 */

.flag-in-modal {
    position: fixed;
    opacity: 0;
    transition: transform .2s, opacity .05s .15s;
}

.modal.open .flag-in-modal {
    opacity: 1;
    transition: transform .3s;
}

/*
 * Modal Caption
 */

.modal-caption {
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    position: fixed;
    margin: 16px auto 0;
    text-align: center;
    opacity: 0;
    transition: all .1s;
}

@media only screen and (max-height: 414px) {
    .modal-caption {
        font-size: 18px;
        margin: 8px auto 0;
    }
}

.modal.open .modal-caption {
    transition: all .6s .2s;
    opacity: 1;
}