*{
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', sans-serif;
}

body{
    max-height: 100vh;
}

.header{
    border-top: 5px solid #9b0000;
    background: #d50000;
}

.header-inner{
    max-width: 1200px;
    padding: 0px 10px 10px 10px;
    text-align: center;
    margin: 0 auto;
    color: #fff;
}

.main__wrapper{
    max-width: 760px;
    margin: 0 auto;
    margin-top: 1em;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-around;
}

.main__item-box{
    width: 24%;
    margin-top: 0.5em;
    box-sizing: border-box;
    min-height: 150px;
    cursor: pointer;
    perspective: 1000px;
}

.main__item-box:hover{
    box-shadow: 1px 3px 7px 0px rgba(0,0,0,0.51);
    transform: scale(1.01);
    transition: all ease-out 0.2s;
}


/*cards images*/
.card__0{
    background: url(../img/chip-6.png) center center no-repeat;
    background-size: contain;
}

.card__1{
    background: url(../img/chip.png) center center no-repeat;
    background-size: contain;
}

.card__2{
    background: url(../img/clubs.png) center center no-repeat;
    background-size: contain;
}

.card__3{
    background: url(../img/diamonds.png) center center no-repeat;
    background-size: contain;
}

.card__4{
    background: url(../img/hearts.png) center center no-repeat;
    background-size: contain;
}

.card__5{
    background: url(../img/spades.png) center center no-repeat;
    background-size: contain;
}


/*flipper functionality*/
.front, .back {
	width: 100%;
    min-height: 150px;
    box-shadow: 1px 2px 5px 0px rgba(0,0,0,0.11);
}

.flipper {
	transition: 0.4s;
	transform-style: preserve-3d;
	position: relative;
}

.front, .back {
	backface-visibility: hidden;
	position: absolute;
	top: 0;
	left: 0;
}

.front {
	z-index: 2;
	transform: rotateY(0deg);
}

.back {
    transform: rotateY(180deg);
    background: url(../img/poker.png) center center no-repeat;
    background-size: contain;
    
}

.main__item-box.flipped .flipper {
	transform: rotateY(180deg);
}


/*dialog window*/
.dialog-wrapper{
    height: 100%;
    width: 100%;
    background: rgba(0,0,0,0.8);
    position: fixed;
    z-index: 9;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.dialog-window{
    max-width: 310px;
    width: 100%;
    padding: 10px;
    text-align: center;
    border-radius: 7px;
    box-sizing: border-box;
    background: #fff;
    position: relative;
    z-index: 10;
}


.dialog-window h2{
    color: #333;
    font-size: 175%;
    margin: 10px;
}

.dialog-window p{
    margin: 10px;
}

.dialog-window button{
    background: #d50000;
    border: 1px solid transparent;
    color: #fff;
    border-radius: 2px;
    padding: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    cursor: pointer;
    transition: all ease-out 0.2s;
}

.dialog-window button:hover{
    background: #fff;
    border: 1px solid #d50000;
    color: #d50000;
    transition: all ease-out 0.2s;
}

.dialog-window #button-quit{
    background: green;
}

.dialog-window #button-quit:hover{
    background: #fff;
    border: 1px solid green;
    color: green;
    transition: all ease-out 0.2s;
}


/*helpers*/
.show{
    pointer-events: none;
}

.cardhide{
    visibility: hidden;
}

.none{
    display: none;
}

.score-wrapper{
    background: #fff;
    padding: 1px 5px;
    border-radius: 3px;
    margin-top: 5px;
    box-sizing: border-box;
    display: inline-block;
    color: #d50000;
}

.score-wrapper span{
    font-size: 120%;
    font-weight: 700;
}


/*media query*/
@media screen and (max-width: 400px){
    .main__item-box{
        min-height: 120px;
    }

    .front, .back {
        min-height: 120px;
    }
}