html, body {
    width: 100%;
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    background: black;
    color: white;
}

#home {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
}

#logo {
    width: 100vw;
    max-width: calc(100vh * 0.4);
    height: calc(100vh * 0.4);
    max-height: 100vw;

    box-shadow: 0px 0px 20px 15px white;
}

#puzzle-carousel {
    width: 100vw;
    height: calc(100vh * 0.4);
	
	display: flex;
	flex-direction: row;
    align-items: center;
    justify-content: center;
    
    overflow: hidden;

    touch-action: none;
}

#left-arrow {
    background-image: url('img/LArrow.png');
}
#right-arrow {
    background-image: url('img/RArrow.png');
}

.arrow {
    width: calc(100vw * 0.05);
    max-width: calc(100vh * 0.4);
    height: calc(100vh * 0.4);
    /* max-height: calc(100vw * 0.1); */
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
}

#puzzle-container {
    transform-style: preserve-3d;
    transition: transform 0.5s;

    width: calc(100vw * 0.6);
    max-width: calc(100vh * 0.4);
    height: calc(100vh * 0.4);
    max-height: calc(100vw * 0.6);
}

.puzzle {
    width: 100%;
    height: 100%;
    box-sizing: border-box;

    background-size: contain;
	background-position: top; 
    background-repeat: no-repeat;
    background-origin: content-box;
}
.puzzle:not(:first-of-type) {
    position: absolute;
    left: 0;
    top: 0;
}

#back-to-home {
    position: fixed;
    top: -5px;
    right: 5px;
    font-size: 300%;
    cursor: pointer;
    z-index: 999;
}
  
#container {
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: space-around;

    touch-action: none;
}

.row-layout {
    flex-direction: row;
}

.column-layout {
    flex-direction: column;
}

#table, #cards {
    background: lightyellow;
}

.horizontal-responsive {
    width: calc(100vw * 0.45);
    max-width: 100vh;
    height: 100vh;
    max-height: calc(100vw * 0.45);
}

.vertical-responsive {
    width: 100vw;
    max-width: calc(100vh * 0.45);
    height: calc(100vh * 0.45);
    max-height: 100vw;
}

table {
    width: 100%;
    height: 100%;
}

td {
    width: 25%;
    height: 25%;
    position: relative;
    background: #ece6cf;
    background-size: contain !important;
}

td.logo {
    background: transparent;
}

td.matrix-header {
    background: silver;
}

td.dropzone.active {
    background: gold;
}

#cards {
    position: relative;
}

.card {
    width: 22%;
    height: 22%;
    position: absolute;
    right: -50%;
    bottom: -50%;
    background-size: cover;
    border-radius: 10%;
    box-shadow: 2px 2px 10px 1px rgba(0,0,0,0.5);
}

.card-sliding {
    transition: all 500ms ease-in-out;
}

.draggable.active {
    pointer-events: none;
}

footer {
    width: 100vw;
    height: 100vh;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    background-color: rgba(0,0,0,0.8);   
}

#congrats {
    font-family: "Comic Sans MS", cursive, sans-serif;
    font-size: calc(100vw / 12);
    font-weight: bold;
    font-variant: small-caps;
    letter-spacing: 5px;
    color: lemonchiffon;
    text-shadow: 0 0 5vw gold, 0 0 2vw red;
}
#congrats:first-letter {
    padding-left: 2vw;
}

#recommendation {
    width: calc(100vmin * 0.3);
    max-width: calc(100vmin * 0.3);
    height: calc(100vmin * 0.3);
    max-height: calc(100vmin * 0.3);

    position: relative;
}


/* ANIMATIONS */

.persp {
	position: relative;
	width: 100%;
	height: 100%;
	perspective: 1200px;
}

.page {
	width: 100%;
	height: 100%;
	position: absolute;
	top: 0;
	left: 0;
	visibility: hidden;
	overflow: hidden;
	backface-visibility: hidden;
	transform: translate3d(0, 0, 0);
	transform-style: preserve-3d;
}

.page-current {
	visibility: visible;
}

.page-flipOutTop {
	transform-origin: 50% 50%;
	animation: flipOutTop .5s both ease-in;
}

.page-flipInBottom {
	transform-origin: 50% 50%;
	animation: flipInBottom .5s both ease-out;
}

.page-delay500 {
	animation-delay: .5s;
}

.wrong-placement {
    animation: wrongPlacement 0.5s 2;
}

.splash {
    position: fixed;
    top: 0;
    left: 0;    
}

.splash-in {
    animation: splashIn 0.75s both cubic-bezier(0.7,0.3,.5,1.3);
}

.splash-out {
    animation: splashOut 0.5s both cubic-bezier(0.7,0.3,.5,1.3);
}

.speed-in {
    animation: speedInX 1s both, speedInSkew 1s both;
    animation-delay: 1s;
}

.speed-out {
    animation: speedOutX 1s ease-in both, speedOutSkew 1s both ease-in;
}

.pulse {
    animation: pulse 0.5s ease-in-out infinite alternate;
    animation-delay: 0.4s;
}

@keyframes flipOutTop {
	from { }
	to { transform: translateZ(-1000px) rotateX(90deg); opacity: 0.2; }
}

@keyframes flipInBottom {
	from { transform: translateZ(-1000px) rotateX(-90deg); opacity: 0.2; }
}

@keyframes wrongPlacement {
    0%, 100% {
      background-color: #a29567;
    }
    50% {
      background-color: red;
    }
}

@keyframes splashIn {
    from { transform: scale(0); background-color: rgba(0,0,0,0) }
	to { transform: scale(1); background-color: rgba(0,0,0,0.8) }
}

@keyframes splashOut {
	from { transform: scale(1); background-color: rgba(0,0,0,0.8) }
    to { transform: scale(0); background-color: rgba(0,0,0,0) }
}

@keyframes speedInX {
    0% { left: -70vw; }
    100% { left: 0vw; }
}

@keyframes speedOutX {
    0% { left: 0vw; }
    100% { left: 100vw; }
}

@keyframes speedInSkew {
    0% { transform: skewX(0deg); }
    15% { transform: skewX(20deg); }
    30% { transform: skewX(0deg); }
    50% { transform: skewX(0deg); }
    75% { transform: skewX(-10deg); }
    100% { transform: skewX(0deg); }
}

@keyframes speedOutSkew {
    to { transform: skewX(20deg);  }
}

@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(0.9); }    
}
