/* Fonts */

@font-face {
    font-family: 'Crete Round';
    src: url("../fonts/CreteRound-Regular.ttf");
}
@font-face {
    font-family: 'Segoe UI';
    src: url("../fonts/segoeui.ttf");
}

/* Overarching UI */

html,body{
    margin:0;
    padding:0;
}

body{
    font-family: 'Segoe UI';
    font-size: 16px;
}

@media (orientation: landscape) {
    body {
        display: flex;
        min-height: 100vh;
        flex-direction: row;
    }
}

@media (orientation: portrait) {
    body {
        display: flex;
        flex-direction: column;
    }
}

@media (orientation: landscape) and (max-width: 1300px) {
    body{
        font-size: 1.3vw;
    }
}
/* @media (orientation: landscape) and (max-height: 830px) {
    body{
        font-size: 2vh;
    }
} */

/* Reusable elements */

.button{
    background-color: #00add9;
    color: white;
    border-radius: 2em;
    padding: .5em 1em;
    transition: opacity 1s linear;
    cursor: pointer;
    font-family: "Crete Round";
    white-space: nowrap;
    text-align: center;
    text-decoration: none;
}

.button:hover{
    background-color: #7CDCF5;
}

.button:active{
    background-color: #0087AA;
}

.hidden{
    display: none;
    visibility: collapse;
}
.opaque{
    opacity: 0;
    pointer-events: none;
    display: none;
}
.tempHidden{
    opacity:0;
    transform:scale(0.9)
}

/* Aside */

aside{
    background-color: #00add9;
    color: white;
    font-family: "Crete Round";
    text-align: center;
    display: flex;
}


aside h1{
    font-weight: normal;
}

@media (orientation: landscape) {
    aside{
        justify-content:flex-start;
        align-items: center;
        flex-direction: column;
        padding: 0 1em 1em 1em;
        flex: 1;
        font-size: 2em;
    }
    #logo{
        width: 6em;
    }
    aside h1{
        margin-bottom: 0;
        font-size: 2em;
    }
}

@media (orientation: portrait) {
    aside{
        flex-direction: row-reverse;
        justify-content: space-between;
        align-items: center;
        padding: .8em 2em;
    }
    #logo{
        margin-top: -1em;
        width: 6em;
    }
    aside h1{
        font-size: 3em;
        margin: 0;
    }
    #vText{
        display: none;
        visibility: collapse;
    }
}

/* Main content area */

main{
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    text-align: center;
    flex-direction: column;
}
@media (orientation: landscape) {
    main{
        padding-top: 1em;
        flex: 3;
    }
}

@media (orientation: portrait) {
    main{
        padding: 1em;
    }
}

/* Start screen */

#welcome p{
    font-family: 'Crete Round';
    color: #00ADD9;
}
.welcomeImages img{
    width: 100%;
}
#welcome .button{
    padding: .25em;
    font-weight: normal;
}
@media (orientation: landscape) {
    #welcome{
        padding: 1em;
        max-width: 900px;
        margin: auto;
    }
    .welcomeText{
        padding: 0 14em;
    }
    #welcome p{
        font-size: 3em;
    }
    .welcomeImages{
        display:flex;
        align-items: center;
    }
    .welcomeImages>*:first-child,
    .welcomeImages>*:last-child{
        flex: 1 1 20%;
    
    }
    .welcomeImages>*:nth-child(2){
        flex: 1 1 40%;
    }
    #welcome .button{
        font-size: 2em;
    }
    
}
@media (orientation: landscape) and (max-width: 1300px) {
    .welcomeText{
        padding: 0 13em;
    }
}

@media (orientation: portrait) {
    #welcome{
        font-size: 1em;
    }
    #welcome p{
        font-size: 8vw;
        margin: 0 10vw;
    }
    .welcomeImages{
        display:flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    .welcomeImages>*{
        max-width: 45vw;
    }
    .welcomeImages>*:first-child,
    .welcomeImages>*:last-child{
        flex: 1 1 35vw;
    
    }
    .welcomeImages>*:nth-child(2){
        flex: 1 1 45vw;
    }
    #welcome .button{
        font-size: 5vw;
    }
}

/* Grid screen */


#gridWrapper{
    width: 600px;
    margin: auto;
    font-size: 16px;
}
@media (orientation: landscape) {
    #gridWrapper{
        max-width: calc(100% - 2em);
    }
}

@media (orientation: portrait) {
    #gridWrapper{
        max-width: 100%;
    }
}

@media (orientation: portrait) and (max-width: 630px) {
    #gridWrapper{
        font-size: 2.75vw;
    }
}

#gridTitel{
    font-family: 'Crete Round';
    font-size: 2em;
    margin-bottom: 0;
    font-weight: normal;
}
#gridUndertitel{
    font-family: 'Crete Round';
    font-size: 1.3em;
    margin-top: 0;
}

.grid{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1em;
    padding: 1em 0;
}


.gridElement{
    background-color: #00add9;
    border-radius: 1em;
    /* aspect-ratio: 1 / 1; */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1em;
    text-align: center;
    cursor: pointer;
    -webkit-user-select: none;
       -moz-user-select: none;
        -ms-user-select: none;
            user-select: none;
    background-position: center;
    background-size: cover;
    color: #fff;
    font-weight: bold;
    white-space: wrap;
    border: 1px solid #FFFFFF;
    box-shadow: 0px .15em .3em #00000029;
}
.gridElement:before{
    content: "";
    width: 100%;
    padding-top: 100%;
    pointer-events: none;
    
}
.gridElement:hover, .gridElement:focus{
    box-shadow: 0px .25em .4em #0000008F;
    outline: none;
}
.gridElement.selected{
    outline: 4px solid #7CDCF5;
    border: 1px solid #7CDCF5;
}

#gridWrapper .buttons{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1em;
}

#gridWrapper .buttons>*{
    display:flex;
    align-items: center;
    justify-content: center;
    padding: 0 .5em;
}
.pager{
    font-family: "Crete Round";
    font-size: 1.5em;
    color: #00ADD9;
    white-space: pre;
}
#deck{
    display: inline-block;
    text-align: right;
    width: .6em;
}

#gridWrapper .button{
    width: 100%;
}

@media (orientation: landscape) and (max-height: 50em) {
    #gridWrapper{
        width: 70vh;
        /* font-size: .8em; */
    }
}

@media (orientation: portrait) and (max-height: 60em) {
    #gridWrapper{
        width: 65vh;
        /* font-size: .8em; */
    }
}

@media (orientation: portrait) and (max-height: 50em) {
    #gridWrapper{
        width: 60vh;
        /* font-size: .8em; */
    }
}

@media (orientation: portrait) and (max-height: 45em) {
    .grid{
        margin: 0 1em;
    }
}


/* Sucess screen */

#hjärta{
    max-width: 25em;
    max-height: 20em;
}
    
.grattis h2{
    font-size: 2.5em;
    font-family: "Crete Round";
    font-weight: normal;
}

.grattisNederst .text{
    text-align: left;
}
.spm{
    font-size: 1.5em;
    font-family: "Crete Round";
    margin: .5em 0;
}
.grattis .buttons{
    display: flex;
    padding: .5em 1em;
    gap: .5em 1em;
    align-items: center;
    box-sizing: border-box;
}

@media (orientation: landscape) {
    .grattis{
        width: calc(100% - 2em);
        flex-wrap: wrap;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        margin-top: -3em;
    }
    
    #hjärta{
        position: relative;
        top: 3em;
        right: 4em;
    }
    
    .grattisNederst{
        display: flex;
        align-items: center;
        gap: 1em;
    }
    
    .grattisNederst img{
        max-width: 25em;
        flex: 1 1 55%;
    }
    .grattisNederst .text{
        max-width: 28em;
        flex: 1 1 35%;
    }
    
    .spm{
        font-size: 1.5em;
        font-family: "Crete Round";
        margin: .5em 0;
    }
    
    .grattis .buttons{
        justify-content: space-between;
        margin: auto;
        padding: 0;
        margin-bottom: 1em;
    }
    .grattis .button{
        margin: 0;
        flex: 1 1 auto;
    }
    #stamp{
        display: none;
    }
}
@media (orientation: portrait) {
    .grattis{
        margin-top: 0;
    }
    #hjärta{
        position: static;
    }
    .grattisNederst{
        flex-direction: column;
    }
    .grattisNederst img,
    .grattisNederst .text{
        max-width: 100%;
    }
    .grattis .buttons{
        padding-bottom: 1em;
        flex-direction: column;
    }
    .grattis .button{
        width: 100%;
    }
    .grattis h2{
        text-align: center;
    }
    #stamp{
        width: calc(100% + 2em);
        margin-left: -2em;
    }
}