memory-card {
    background: transparent;
    display: block;
    width: var(--size);
    height: var(--size);
    perspective: 1000px;
}

memory-card .sides {
    position: relative;
    width: 100%;
    height: 100%;

    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
}

memory-card .facedown, memory-card .faceup {
    position: absolute;
    width: 100%;
    height: 100%;

    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 4px;
}

memory-card .facedown {
    display: flex;
    background: #ddd;

    border: var(--border) solid #ccc;
    padding: 5px;
    width: calc(100% - 10px - var(--border)*2);
    height: calc(100% - 10px - var(--border)*2);
}

memory-card .facedown img {
    width: 100%;
}

memory-card .faceup {
    background: white;
    transform: rotateY(180deg);

    border: var(--border) solid #eee;
    width: calc(100% - var(--border)*2);
    height: calc(100% - var(--border)*2);
}

memory-card {
    cursor: pointer;
}

memory-card.flip .sides {
    transform: rotateY(180deg);
}

/* --- */

body {
    width: 100vw;
    height: 100vh;
    margin: 0px;
    font-family: Arial, Helvetica, sans-serif;

    /*position: relative;

    display: flex;
    justify-content: center;
    align-items: center;*/

    /*position: relative;
    padding-bottom: 0%;*/
}

main {
    /*position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;*/

    position: absolute;
    top: 0; left: 0;

    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

h3 {
    display: inline-block;
    text-align: center;
}

h3 b {
    font-size: 1.5em;
}

#stats {
    margin: 0px auto;
    display: flex;
    justify-content: space-between;
    width: 500px;
}

#grid {
    --columns: 100px 100px;
    --size: 75px; /* 125px, 100px, 75px */
    --border: calc(var(--size) * 0.075);
    display: grid;
    grid-gap: 10px;
    grid-template-columns: var(--columns);
    margin: auto auto auto auto;

    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -o-user-select: none;
    user-select: none;   

    position: relative;
}

@media only screen and (max-width: 600px) {

    #grid {
        position: absolute;
        top: 0px;
        left: 50%;
        transform-origin: center;
        transform: scale(0.5) translate(-100%, 0%);
        position: relative;
    }
}

/* --- */

#ui {
    position: absolute;
    transition: .25s all;
	z-index: 10;
}

.ui-popup-container {
    display: flex;
    position: fixed;
    width: 100vw;
    height: 100vh;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, .25);
    transition: 1s all;
    opacity: 0;
}

.ui-popup-container:not([disabled]) {
    opacity: 1;
}

.ui-popup-container[disabled] {
    pointer-events: none;
    
    opacity: 0;
}

.ui-popup-container[disabled] .ui-popup {
    transform: translateY(50px);
    opacity: 0;
}

.ui-popup {
    padding: 15px;
    background: white;
    border-radius: 5px;
    text-align: center;
    transform: translateY(0px);
    transition: all .5s;
}

.ui-popup form {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.error-message {
    color: red;
    transform: translateY(-1.15em);
}

input[type="button"] {
    color: white;
    background: black;
    padding: 10px 25px;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    transition: .25s all;
}

a {
    color: #bbb;
    text-decoration: none;
}

/* 
 * Google inputs
 * https://codepen.io/benftwc/pen/VpQjNL
 */

 .google-input { 
    position:relative; 
    margin-bottom:45px; 
}
.google-input input {
    font-size:18px;
    padding:10px 10px 10px 5px;
    display:block;
    width:300px;
    border:none;
    border-bottom:1px solid #757575;
}

.google-input input:focus { outline:none; }

.google-input label {
	color:#999; 
	font-size:18px;
	font-weight:normal;
	position:absolute;
	pointer-events:none;
	left:5px;
	top:10px;
	transition:0.2s ease all; 
	-moz-transition:0.2s ease all; 
	-webkit-transition:0.2s ease all;
}

.google-input input:focus ~ label, .google-input input:valid ~ label {
	top:-20px;
	font-size:14px;
	color:#5264AE;
}

.google-input .bar { position:relative; display:block; width:300px; }
.google-input .bar:before, .google-input .bar:after {
	content:'';
	height:2px; 
	width:0;
	bottom:1px; 
	position:absolute;
	background:#5264AE; 
	transition:0.2s ease all; 
	-moz-transition:0.2s ease all; 
	-webkit-transition:0.2s ease all;
}

.google-input .bar:before {
	left:50%;
}

.google-input .bar:after {
	right:50%; 
}

.google-input input:focus ~ .bar:before, .google-input input:focus ~ .bar:after {
	width:50%;
}

.google-input .highlight {
	position:absolute;
	height:60%; 
	width:100px; 
	top:25%; 
	left:0;
	pointer-events:none;
	opacity:0.5;
}

.google-input input:focus ~ .highlight {
	-webkit-animation:inputHighlighter 0.3s ease;
	-moz-animation:inputHighlighter 0.3s ease;
	animation:inputHighlighter 0.3s ease;
}

@-webkit-keyframes inputHighlighter {
	from { background:#5264AE; }
  	to 	{ width:0; background:transparent; }
}
@-moz-keyframes inputHighlighter {
	from { background:#5264AE; }
  	to 	{ width:0; background:transparent; }
}
@keyframes inputHighlighter {
	from { background:#5264AE; }
  	to 	{ width:0; background:transparent; }
}