:root{
    --bj-main: #08c;
    --bj-accent: #ffc54d;
    --bj-magenta: #d32064;
    --bj-purple: #22020e;
    --bj-teal: #40ffde;
    font-size: 18px;
    text-transform: capitalize;
}

html, main, body{
    width: 100%;
    height: 100%;
    margin: 0;
    font-family: aaux-next, sans-serif;
    color: white;
    background-color: black;
}

header{
    width: 100%;
    height: 48px;
    position: absolute;
    top:0;
    z-index: 1;
}

h1{
    text-align: center;
    text-transform: uppercase;
    font-family: all-round-gothic, sans-serif;
    font-size: 48px;
    font-weight: 550;
    margin: 10px 50%;
    color: var(--bj-accent);
    order: 2;
}

h2{
    margin: 0.5em;
    font-family: all-round-gothic, sans-serif;
    font-size: 2rem;
    color: var(--bj-accent);
    text-transform: uppercase;
    text-align: center;
}

h4{
    margin: 0.5em;
    font-family: all-round-gothic, sans-serif;
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--bj-accent);
    text-transform: uppercase;
    display: none;
}

body{
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    box-sizing: border-box;
}

p{
    text-transform: uppercase;
    margin: 0;
}

footer{
    display: none;
    position: absolute;
    bottom: 2px;
    width: 100%;
    height: 24px;
    text-align: center;
    color: var(--bj-main);
}

.homelink{
    color: var(--bj-magenta);
}

/* === CAROUSEL === */

.view{
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.carousel{
    background-image: url(images/bg/desktop-01.jpg);
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    width: 300%;
    height: 100%;
    display: flex;
    position: relative;
    right: 0;
    transition: right 1s;
}

.slide{
    width: 100%;
    overflow: hidden;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    box-sizing: border-box;
}

/* === TITLE SCREEN === */

.img-container{
    margin: 20px auto 10px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    flex-wrap: wrap;
}

.tsuit{
    height: 7%;
    margin: 10px 5px 0;
    margin-bottom: 0;
    order: 1;
}
#luckycat{
    height: 50%;
    margin: 0 50%;
    order: 0;
}
#title-menu{
    max-width: 440px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}
#title-screen{
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    align-items: flex-end;
    justify-content: center;
}
#title-screen > button{
    height: 48px;
    width: 200px;
    margin: 5px;
    background-color: var(--bj-purple);
    color: var(--bj-teal);
    border: 3px solid var(--bj-teal);
    border-radius: 20px;
    font-size: 24px;
    box-sizing: border-box;
    order: 3;
}
/* === GAME === */

#playarea{
    width: 100%;
    height: 100%;
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#help{
    opacity: 0;
    height: 32px;
    width: 32px;
    border-radius: 50%;
    border: 1px solid white;
    background: transparent;
    color: white;
    position: absolute;
    top: 0;
    right: 10px;
    z-index: 100;
    transition: background-color 0.5s,
        color 0.5s,
        opacity 1s;
}

#help:hover{
    cursor: pointer;
    background-color: white;
    color:black;
}

/* === SCORE ZONES === */

.score{
    text-align: center;
    background-color: rgba(0,0,0,0.5);
}

/* === CREDITS === */

.credits{
    overflow: hidden;
    width: 100%;
    background-color: rgba(0,0,0,0.5);
}
.credits > p{
    display: inline;
    margin: 0 20px;
}
#credits{
    float: right;
}
.winnings{
    float: right;
    margin-right: 10px;
    position: relative;
    color: #6f0;
    animation-duration: 2s;
    animation-name: winreveal;
}

/* === HANDS ===*/
.hand{
    height: 35%;
    width: 100%;
    position: relative;
}

/*=== CARDS ===*/

.cards{
    width: 140px;
    height: 140px;
    margin: 10px auto;
    position: relative;
    overflow: hidden;
}
.card{
    height: 100%;
    width: 100px;
    box-sizing: border-box;
    padding: 10px;
    color: black;
    background-color: white;
    border-radius: 5px;
    box-shadow: -1px 0 black;
    position: absolute;
}
.dealt{
    animation-duration: 0.5s;
    animation-name: dealcard;
}
.expand{
    transition: width 250ms;
}
.card > div{
    width: fit-content;
}
.card > img{
    display: block;
    margin: 0 auto;
}
.rank{
    font-family: all-round-gothic, sans-serif;
    font-size: 1.25rem;
    margin: 0;
    text-align: center;
}
.facedown{
    background-color: var(--bj-purple);
    border: 8px solid white;
}
.facedown > div, .facedown > img{
    display: none;
}

/*=== CONTROLS ===*/

button{
    width: 140px;
    height: 48px;
    margin: 10px;
    border: 1px solid white;
    outline: none;
    border-radius: 5px;
    color: white;
    background-color: var(--bj-main);
    font-family: aaux-next, sans-serif;
    font-size: 1rem;
    text-transform: uppercase;
    transition: background-color 0.125s;
    transition: opacity 0.5s;
}
button:hover{
    cursor: pointer;
}
button:active{
    background-color: var(--bj-accent);
}
button:disabled{
    opacity: 0;
}
#controls{
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-wrap: wrap;
}
#buttonA{
    order: 1;
}
#buttonB{
    order: 3;
}
#buttonC{
    order: 2;
}
#buttonD{
    order: 4;
}
/*=== RESULTS ===*/

.result{
    font-family: all-round-gothic, sans-serif;
    font-size: 1.2rem;
    font-weight: 400;
    text-transform: uppercase;
    text-align: center;
    width: 40%;
    margin-left: 30%;
    box-sizing: border-box;
    border: 2px solid;
    box-shadow: 0 0 0 1px var(--bj-purple);
    position: absolute;
    top: 120px;
    background-color: var(--bj-purple);
    animation-duration: 1s;
    animation-name: textreveal;
}

.bj{
    color: var(--bj-accent);
}
.w{
    color: var(--bj-magenta);
}
.l{
    color: var(--bj-main);
}
.hidden{
    display:none;
}

/* === HOW TO ===*/

#instructions{
    overflow-y: scroll;
}
h3{
    color: var(--bj-teal);
    text-transform: uppercase;
    font-weight: 400;
}
strong{
    color:var(--bj-accent);
    font-weight: 550;
    text-transform: uppercase;
}
em{
    color:var(--bj-accent);
}
.toc{
    padding: 0;
    list-style-type: none;
    display: flex;
    justify-content: center;
    background-color: rgba(0,0,0,0.75);
}
li{
    text-transform: none;
}
.toc > li{
    text-transform: capitalize;
    padding: 0 0.5em;
    border-left: 1px solid var(--bj-magenta);
}
.toc > li:first-child{
    border-left:none;
}
.toc-link{
    color: var(--bj-magenta);
    font-size: 1.1rem;
    text-decoration: underline;
}
.toc-link:hover{
    cursor:pointer;
}
.section{
    max-width: 620px;
    padding: 10px 20px;
    margin: 15px;
    background-color: var(--bj-purple);
    border: 1px solid var(--bj-teal);
}
.section > p{
    text-transform: none;
    margin: 1em 0;
}
.btt{
    color: var(--bj-accent);
    text-decoration: underline;
    font-style: italic;
    text-align: center;
}
.btt:hover{
    cursor:pointer;
}

/* === TABLE === */
table{
    width: 100%;
    max-width: 500px;
    margin: 15px auto;
}
tr:first-child > th{
    font-weight: 400;
    font-style: italic;
}
th{
    width: 7.5%;
}
th:first-child{
    width: 25%;
    text-align: left;
}
td{
    text-align:center;
}
.hit{
    background-color: var(--bj-accent);
    color: #000;
}
.stand{
    background-color: var(--bj-main);
}
.double{
    background-color: var(--bj-magenta);
}

@media screen and (min-width: 480px) {

}

@media screen and (min-width: 640px){
    header{
        background-color: #000;
    }
    h1{
        font-size: 72px;
        margin: 20px 50%;
    }
    h4{
        display: block;
    }
    #title-screen{
        background-image: url(images/bg/desktop-01.jpg);
    }
    #game{
        background-image: url(images/bg/desktop-02.jpg);
    }
    #instructions{
        background-image: url(images/bg/desktop-03.jpg);
    }

    /* === CAROUSEL === */

    .carousel{
        background-image: none;
    }
    .slide{
        padding-top: 48px;
    }

    /* === TITLE SCREEN === */

    .img-container{
        margin: 30px;
        flex-wrap: nowrap;
    }
    .tsuit{
        height: 11%;
        margin: 20px;
        margin-bottom: 0;
        order: initial;
    }
    #luckycat{
        height: 55%;
        margin: 0;
        order: initial;
    }
    #title-menu > button{
        height: fit-content;
        font-size: 36px;
        margin: 10px;
    }

    /* === GAME === */

    #controls{
        max-width: 640px;
    }
    #buttonB{
        order: 2;
    }
    #buttonC{
        order: 3;
    }

    /* === HOW TO === */
    .section{
        margin: 15px auto;
    }
}

/*=== ANIMATIONS ===*/

@keyframes textreveal{
    from{
        top:144px;
        opacity: 0;
    }
    to{
        top:120px;
        opacity: 1;
    }
}

@keyframes dealcard{
    from{
        top: -100%;
    }
    to{
        top: 0;
    }
}

@keyframes winreveal{
    from{
        top: 50px;
        opacity: 0;
    }
    25%{
        top: 0;
        opacity: 1;
    }
    75%{
        top: 0;
        opacity: 1;
    }
    to{
        top: -50px;
        opacity: 0;
    }
}