@keyframes hover {
    0%   {margin-top: 0}
    50%  {margin-top: -50px}
    100% {margin-top: 0}
}

@keyframes flyby {
    0%   {left: -100px}
    25%   {left: 35%}
    50%  {left: 80%}
    100% {left: 100%}
}

@keyframes animateBorder {
    0% {border-color: #22f791}
    25% {border-color: blue}
    50% {border-color: red}
    100% {border-color: #22f791}
}

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
  }

* {
    font-family: Comic Sans MS,Arial,Helvetica,sans-serif
}

body{
    background-color: #001743;
    background: url(img/star-bg.gif);
    background-repeat: repeat;
    min-height: 98vh;
    color: #FCFBFC;
    margin: 0;
}
.flying-plane {
    background: url(img/spaceship2.gif);
    background-repeat: no-repeat;
    background-size: 100%;
    width: 100px;
    height: 100px;
    display: block;
    position: absolute;
    top: 155px;
    left: -100px;
    animation-name: flyby;
    animation-delay: 2s;
    animation-duration: 10s;
    animation-iteration-count: infinite;
}

.wrapper {
    padding: 0 35px;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

header {
    height: 70px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h2 {
    text-shadow: 3px 3px #ff0000;
    text-align: center;
}

header .logo img {
    height: 50px;
}

.nav-links{
    list-style: none;
}
.nav-links li {
    display: inline-block;
    font-size: 18px;
}
.nav-links a {
    color: #FFF;
    margin: 10px;
    text-decoration: none;
    border-bottom: 1px solid #FFF;
}

.page-title {
    width: 100%;
    margin-bottom:1rem;
}
.page-title img {
    display: block;
    position: relative;
    z-index:2;
    margin: auto;
    max-width: 100%;
}

.main-content {
    min-height: 55vh;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
}

.sidebar {
    width: 13%;
    padding: 10px;
    position: relative;
    background-color: rgba(215, 003, 005, 0.5);
    text-align: center;
    border: 2px solid;
}

.sidebar h3 {
    font-size: 25px;
    margin-bottom: 15px;
    text-decoration: underline;
}
.sidebar p{
    line-height: 2;
    margin-bottom: 1rem;
}
.sidebar p span {
    display: block;
}
.sidebar .reset-btn {
    background-color: #22f791;
    border: 2px solid #FFF;
    padding: 10px 25px;
    display: block;
    font-weight: bold;
    position: relative;
    left: 50%;
    top: 20px;
    transform: translateX(-50%);
}
.sidebar .reset-btn:hover {
    cursor: pointer;
    opacity: .7;
}
.sidebar:after {
    content: "";
    background: url(img/bgFury.gif);
    background-repeat: no-repeat;
    background-size: 100%;
    width: 120px;
    height: 120px;
    display: block;
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
}
.card-container {
    width: 83%;
    padding: 25px 0 45px;
    display: flex;
    justify-content: center;
    background-color: rgba(102, 100, 116, .5);
    position: relative;
    border: 2px solid #CCC;
}

.card-container:before {
    content: "";
    background: url("img/captain-marvel-hover.png");
    background-size: 100%;
    background-repeat: no-repeat;
    position: absolute;
    width: 180px;
    height: 255px;
    z-index: 1;
    left: 0;
    top: 40%;
    transform: translate(-50%, -50%);
    animation-name: hover;
    animation-duration: 10s;
    animation-iteration-count: infinite;
}
.card-container:after {
    content: "";
    background: url(img/superman-hover.png);
    background-size: 100%;
    background-repeat: no-repeat;
    position: absolute;
    width: 175px;
    height: 225px;
    z-index: 1;
    top: 70%;
    right: -65px;
    animation-name: hover;
    animation-duration: 6s;
    animation-iteration-count: infinite;
}
.card-col {
    margin: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    width: 14%;
}

.card-col:nth-of-type(even){
    transform: translateY(30px);
}

.card, .card-inside, .card-front, .card-back {
    border-radius: 10px;
}

.card {
    width: 125px;
    height: 180px;
    margin-bottom: 30px;
    cursor: pointer;
}

.card-inside {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s ease-out, width .5s ease-in;
    transform-style: preserve-3d;
}

.card-inside:before {
    content: "";
    position: absolute;
    width: 98%;
    height: 98%;
    border: 5px solid #000;
    border-radius: 10px;
    z-index: 1;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.card-inside.match:before {
    border: 5px solid #22f791;
}

.card-inside.winning:before {
    animation: animateBorder 3s infinite;
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    box-shadow: 5px 5px 5px rgba(0,0,0,.8);
}


.card.reveal .card-inside{
    transform: rotateY(180deg);
    cursor: default;
}

.card.stanhint .card-inside{
    transform: rotateY(170deg);
}

.card-front {
    transform: rotateY(180deg);
}

.card-front.no-shadow {
    box-shadow: none;
}

.card img {
    width: 100%;
    border-radius: 10px;
}

.popup {
    visibility: hidden;
    max-width: 400px;
    width: 95%;
    height: 185px;
    color: #fff;
    padding: 8px 0;
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.popup .popup-header {
    background-image: linear-gradient(to right,orange, red,blue); 
    border-top: 2px solid #FFF;
    border-left: 2px solid #FFF;
    border-right: 2px solid #314162;
    padding: 3px;
}

.popup .popup-body {
    border-left: 2px solid #FFF;
    border-right: 2px solid #314162;
    border-bottom: 2px solid #314162;
    background-color: #c4e6f0;
    color: #000;
    height: 100%;
}

.popup img{
    width: 135px;
    float: left;
}
.popup .popup-msg {
    width: 250px;
    float: left;
}

.popup button {
    border-top: 2px solid #FFF;
    border-left: 2px solid #FFF;
    border-right: 2px solid #314162;
    border-bottom: 2px solid #314162;
}
.popup button:first-letter {
    text-decoration: underline;
}

.popup.show {
    visibility: visible;
    animation: fadeIn .5s;
}

.stanlee-popup {
    opacity: 0;
    position: absolute;
    bottom: 0;
    background: url("img/stanlee.png");
    background-repeat:no-repeat;
    background-size: 100%;
    height: 0;
    width: 0;
    transition: opacity .5s;
}


.about-container {
    background-image: linear-gradient(red,blue); 
    border: 1px solid #FFF;
    display: block;
    width: 90%;
    max-width: 800px;
    margin: auto;
    font-size: 0;
    padding: 10px;
}

.about-container > * {
    font-size: 1rem;
}

.profile-img {
    display: inline-block;
    width: 25%;
    text-align: center;
}
.profile-img img {
    width:100%;
}
.profile-description {
    width: 75%;
    display:inline-block;
    vertical-align: top;
}

.profile-text {
    padding: 15px;
}

.profile-text h2 {
    text-shadow: 4px 4px blue;
}

.profile-text ul {
    padding-left: 15px;
}

.profile-game-desc img {
    max-width: 300px;
    width: 100%;
}

.profile-link {
    color: #FFF;
}

@media screen and (max-width: 1300px) {
    .wrapper {
        padding: 0 5px;
    }
    .card-container:before, .card-container:after {
        width: 130px;
        height: 165px;
    }
    .card {
        width: 100px;
        height: 143px;
    }
}

@media screen and (max-width: 960px) {
    .sidebar {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        margin-bottom: .25rem;
    }
    .sidebar h3 {
        display: none;
    }
    .sidebar p {
        margin: 5px;
    }
    .sidebar:after {
        width: 45px;
        height: 45px;
        right: -10px;
        left: initial;
        transform: none;
    }
    .sidebar .reset-btn {
        left: initial;
        top: initial;
        transform: none;
        max-height: 50px;
    }
    .card-container {
        width: 100%;
    }
    .card-container:before, .card-container:after {
        display:none;
    }
}

@media screen and (max-width: 767px) {
    header .logo img {
        height: 40px;
    }
    header h2 {
        display: none;
    }
    .sidebar, .card-container{
        display: none;
    }
    .mobile-warning.popup {
        visibility: visible;
        animation: fadeIn .5s;
    }
    .mobile-warning.popup .popup-body {
        display: flex;
        align-items: center;
    }
    .popup {
        height: 165px;
    }
    .popup img {
        width: 95px;
    }
    .popup-options button {
        margin: 5px;
    }
}