/* -------------------
STYLE SECTIONS 
1. GLOBAL
2. MAIN
3. SIDE PANEL CONTENT
4. GAMEBOARD
5. SETTINGS MODAL
6. FOOTER
7. MEDIA QUERIES
------------------- */

/* 1. GLOBAL */

html {
    font-size: 16px;
    box-sizing: border-box;
    height: -webkit-fill-available;
}
* {
    box-sizing: inherit;
}
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    background-color: rgb(251, 244, 234);
    margin: 0;
    padding: 0;
}

/* 2. MAIN */

main {
    display: flex;
    flex-grow: 1;
}
header {
    padding: 0 0 1.5rem 0;
    margin: 0 auto;
} 
h1,
h2 {
    font-family: 'Glass Antiqua', cursive;
    font-style: normal;
    font-variant-ligatures: no-common-ligatures;
    text-align: center;
}
h1 {
    font-size: 2rem;
    letter-spacing: .3rem;
    text-transform: uppercase;
    color: rgb(247, 235, 230);
    background-image: linear-gradient(180deg, rgb(201, 87, 108), rgb(225, 108, 49));
    padding: 1.5rem .625rem 1.5rem .925rem;
    margin: 0;
}
h2 {
    color: rgb(85, 148, 121);
}

/* 3. SIDE PANEL CONTENT */

#side-panel {
    width: 35%;
}
#icons-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}
#icons-wrapper button {
    display: flex;
    align-items: center;
    background-color: inherit;
    border: none;
    padding: 0;
}
.icons {
    height: 1.2rem;
    cursor: pointer;
}
@media (hover: hover) {
    .icons:hover {
        filter: brightness(1.2);
    }
}
.icons:active {
    filter: brightness(1.2);
}
#settings-icon {
    margin-left: 1rem;
}
#side-panel-content {
    padding: 1rem 2.5rem;
}
#moves-counter,
#progress-tracker {
    font-family: 'Julius Sans One', sans-serif;
    font-size: 1.3rem;
    font-weight: bold;
    font-style: normal;
    text-transform: uppercase;
    cursor: default;
}
#progress-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
#progress-tracker {
    font-weight: 400;
    color: rgb(30, 57, 96);
    letter-spacing: .1rem;
    margin: 0;
}
#progress-container,
#progress-bar {
    height: 1rem;
    border-radius: 100px;
}
#progress-container {
    width: 20rem;
    background-color: rgba(178, 196, 202, .5);
}
#progress-bar {
    width: 0;
    background-color: rgb(38, 156, 91);
    background-image: linear-gradient(8deg, rgb(203, 220, 56), transparent);
}
#moves-counter {
    display: flex;
    align-items: center;
    color: rgb(111, 138, 168);
    margin: 0 0 1rem 0;
}
#moves-counter img {
    height: 1.3rem;
}
#moves-num {
    padding: 0 0 0 .4rem;
}
#match-announcement {
    display: none;
    background-image: url('../images/green-match.svg');
    background-repeat: no-repeat;
    background-size: auto;
    height: 4.5rem;
    width: 13rem;
    margin: 1rem auto;
}
#match-type {
    font-family: 'Glass Antiqua', cursive;
    font-variant-ligatures: no-common-ligatures;
    font-style: normal;
    font-weight: bold;
    font-size: 1.1rem;
    color: rgb(55, 69, 84);
    text-transform: lowercase;
    letter-spacing: .4rem;
    text-align: center;
    padding: 1.7rem 0 0 0;
    margin: 0;
}

/* 4. GAMEBOARD */

#gameboard-container {
    display: flex;
    flex-wrap: wrap;
    width: 65%;
    padding: 1.5rem 0;
    background-color: rgb(222, 167, 167);
}
#gameboard {
    display: grid;
    grid-template-columns: repeat(5, max-content);
    grid-template-rows: repeat(4, max-content);
    gap: 2%;
    margin: 1.25rem;
}
#gameboard-container,
#gameboard {
    justify-content: center;
    align-content: center;
}
.tile {
    display: flex;
    width: 9.06rem;
    height: 9.06rem;
    border-radius: 20%;
    border-color: rgb(167, 83, 77);
    border-width: 0 0 5px 0;
    border-style: solid;
    background-image: url("../images/pink-moroccan-tile.png");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    background-color: rgb(255, 255, 255);
    cursor: pointer;
}
.tile:focus {
    box-shadow: hsl(0deg 100% 95%) 0px 0px 4px 3px;
    outline: none;
}
.card-faces {
    max-width: 75%;
    max-height: 75%;
    margin: auto;
    display: none;
}
.match {
    cursor: not-allowed;
}

/* 5. SETTINGS MODAL */

aside {
    display: none;
    position: fixed;
    z-index: 2;
    padding-top: 15%;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(55, 69, 84, .2);
}
#modal-box {
    position: relative;
    background-color: rgb(252, 252, 252);
    margin: auto;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
    width: 30rem;
    -webkit-animation-name: drop-modal;
    -webkit-animation-duration: 0.4s;
    animation-name: drop-modal;
    animation-duration: 0.4s;
}
@-webkit-keyframes drop-modal {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1;}
}
@keyframes drop-modal {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1;}
}
.close {
    display: flex;
    align-items: center;
    justify-content: center;
    float: right;
    cursor: pointer;
    border: none;
    border-radius: 100%;
    height: 1.8rem;
    width: 1.8rem;
}
@media (hover: hover) {
    .close:hover {
        opacity: .5;
    }
}
.close span {
    font-family: 'Julius Sans One', sans-serif;
    font-size: 1.4rem;
    font-weight: bold;
    font-style: normal;
    color: rgb(155, 151, 153);
}
h2 {
    font-size: 1.5rem;
    text-transform: lowercase;
    letter-spacing: .2rem;
    margin: 2rem 0 1.5rem 0;
    padding: 0;
}
#settings-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
}
.settings-option {
    border: none;
    background-color: transparent;
    margin: .5rem;
    cursor: pointer;
}
.theme-img {
    width: 5rem;
    height: 5rem;
}
.theme-text {
    font-family: 'Julius Sans One', sans-serif;
    font-size: .8rem;
    font-weight: bold;
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: .03rem;
    text-align: center;
    color: rgb(55, 69, 84);
}
#divider {
    display: block;
    width: 85%;
    height: 3px;
    background-color: rgb(225, 218, 220);
    margin: 0.5rem auto;
    border-radius: 5px;
}
#toggler-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1.5rem 2rem 1rem 2rem;
}
#toggler-container p {
    font-family: 'Julius Sans One', sans-serif;
    font-size: .7rem;
    font-weight: 300;
    font-style: normal;
    letter-spacing: .06rem;
    color: rgb(55, 69, 84);
    padding-right: 0.4rem;
    margin: 0;
    cursor: default;
}
label {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 17px;
}
.pseudo-focus {
    outline: -webkit-focus-ring-color auto 2px;
    border-radius: 17px;
}
#toggle-announcement {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgb(155, 151, 153);
    -webkit-transition: .4s;
    transition: .4s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 13px;
    width: 13px;
    left: 2px;
    bottom: 2px;
    background-color: rgb(51, 49, 50);
    -webkit-transition: .4s;
    transition: .4s;
}
input:checked + .slider {
    background-color: rgb(222, 167, 167);
}
input:focus + .slider {
    box-shadow: 0 0 1px rgb(222, 167, 167);
}
input:checked + .slider:before {
    -webkit-transform: translateX(13px);
    -ms-transform: translateX(13px);
    transform: translateX(13px);
    background-color: rgb(124, 29, 48);
}
.slider.round {
    border-radius: 17px;
}
.slider.round:before {
    border-radius: 50%;
}

/* 6. FOOTER */

footer {
    background-color: rgb(124, 29, 48);
    position: relative;
    width: 100%;
    bottom: 0;
    margin-top: auto;
}
#copyright {
    font-family: 'Julius Sans One', sans-serif;
    font-size: 10px;
    color: rgb(255, 255, 255);
    padding: 8px 30px;
    margin: 0;
}

/* 7. MEDIA QUERIES */

@media only screen and (max-width: 1313px) {
    
    /* GAMEBOARD */
    
    #gameboard {
        gap: 2%;
    }
    .tile {
        height: 7.812rem;
        width: 7.812rem;
    }
}

@media only screen and (max-width: 1173px) {

    /* MAIN */

    header {
        padding: 0;
    }
    main {
        flex-flow: column-reverse;
        flex-grow: 0;
    }

    /* SIDE PANEL CONTENT */

    #side-panel {
        width: 100%;
    }
    #icons-wrapper {
        order: 3;
        margin-bottom: 0;
    }
    #side-panel-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
    }
    #moves-counter {
        order: 1;
        margin: 0;
    }
    #progress-wrapper {
        order: 2;
    }
    #progress-tracker {
        margin-right: .5rem;
    }
    
    /* GAMEBOARD */

    #gameboard-container {
        width: 100%;
    }
}

@media only screen and (max-width: 710px) {

    /* GAMEBOARD */

    #gameboard {
        grid-template-columns: repeat(4, max-content);
        grid-template-rows: repeat(5, max-content);
        gap: 3%;
    }
}

@media only screen and (max-width: 615px) {

    /* GAMEBOARD */

    #gameboard {
        gap: 2%;
    }
    .tile {
        height: 7.5rem;
        width: 7.5rem;
    }

    /* SIDE PANEL CONTENT */

    .icons {
        height: 1rem;
    }
    #moves-counter,
    #progress-tracker {
        font-size: 1rem;
    }
    #moves-counter img {
        height: 1rem;
    }
    #progress-container {
        width: 14rem;
    }
}

@media only screen and (max-width: 570px) {

    /* MAIN */

    h1 {
        font-size: 1.5rem;
        padding: 2rem .5rem;
    }

    /* GAMEBOARD */

    #gameboard-container {
        padding: 1.35rem 0;
    }
    .tile {
        height: 6rem;
        width: 6rem;
    }
}

@media only screen and (max-width: 440px) {
    
    /* SETTINGS MODAL */

    #modal-box {
        width: 95%;
    }
}

@media only screen and (max-width: 415px) {

    /* MAIN */

    h1 {
        padding: 1rem 0 .5rem .3rem;
    }

    /* GAMEBOARD */

    #gameboard-container {
        padding: 0 0 1rem 0;
    }
    #gameboard {
        padding: 1rem;
        margin: .5rem 0 1.5rem 0;
    }
    .tile {
        height: 5.5rem;
        width: 5.5rem;
    }

    /* SIDE PANEL CONTENT */

    #progress-container {
        width: 11rem;
    }
}

@media only screen and (max-width: 375px) {

    /* SIDE PANEL CONTENT */

    #settings-icon {
        margin-left: .5rem;
    }
    #progress-container,
    #progress-bar {
        height: .8rem;
    }
    #progress-container {
        width: 10rem;
    }

    /* GAMEBOARD */

    .tile {
        height: 5rem;
        width: 5rem;
    }
}
