/*
 * eay: 3x3
 * med: 4x4
 * dif: 5x5
 */

.matchup-grid {
    float: left;
    width: 50%;
    border-left: 1px solid #000;
    border-top: 1px solid #000;
    display: none;
    margin-bottom: 30px;
}

.matchup-grid.complete-message-shown {
    opacity: 0.3;
}

.matchup-grid.is-shown {
    display: block;
}

.matchup-grid .matchup-tile {
    float: left;
    border-right: 1px solid #000;
    border-bottom: 1px solid #000;
    background-color: #F00;
    box-sizing: border-box;
    position: relative;
}

.matchup-grid .matchup-tile:after {
    content: "";
    clear: both;
}

.matchup-grid .matchup-tile:before {
    content: "";
    display: block;
    float: left;
    width: 0;
    height: 0;
    padding-bottom: 100%;
}

.matchup-grid.easy .matchup-tile {
    width: 33.333%;
}

.matchup-grid.easy .matchup-tile:nth-child(3n+1) {
    clear: left;
}

.matchup-grid.medium .matchup-tile {
    width: 25%;
}

.matchup-grid.medium .matchup-tile:nth-child(4n+1) {
    clear: left;
}

.matchup-grid.difficult .matchup-tile {
    width: 20%;
}

.matchup-grid.difficult .matchup-tile:nth-child(5n+1) {
    clear: left;
}

.matchup-grid .matchup-tile .tile-holder {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    display: flex;
    background-color: #FFF;
    align-items: center;
    text-align: center;
    cursor: pointer;
    padding: 10px;
    box-sizing: border-box;
}

.matchup-grid .matchup-tile .tile-holder.is-correct {
    background-color: #333;
}

.matchup-grid .matchup-tile .tile-holder.is-incorrect {
    background-color: #BBB;
}

.matchup-grid .matchup-tile .tile-holder img {
    max-width: 100%;
    max-height: 100%;
    width: auto !important;
    height: auto !important;
    float: none;
    display: inline-block;
    margin: 0 auto;
}

.matchup-grid .matchup-tile .tile-mark-holder {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    display: flex;
    background: none;
    align-items: center;
    text-align: center;
    cursor: pointer;
    padding: 10px;
    box-sizing: border-box;
    z-index: 1;
    display: none;
}

.matchup-grid .matchup-tile .tile-mark-holder.is-shown {
    display: block;
}

.matchup-grid .matchup-tile .tile-mark-holder img {
    max-width: 100%;
    max-height: 100%;
    width: auto !important;
    height: auto !important;
    float: none;
    display: inline-block;
    margin: 0 auto;
}

/** topic picker **/
.matchup-topic-picker {
    float: left;
    width: 50%;
    overflow: hidden;
}

.matchup-topic-picker.complete-message-shown {
    opacity: 0.3;
}

.matchup-topic-picker ul {
    width: 100%;
    margin: 0;
    list-style: none;
    overflow: hidden;
    float: left;
}

.matchup-topic-picker ul li {
    float: left;
    width: 50%;
    padding: 12px;
    box-sizing: border-box;
    text-align: center;
    color: #000;
    font-size: 18px;
}

.matchup-topic-picker ul li:nth-of-type(2n+1) {
    clear: left;
}

.matchup-topic-picker ul li.is-selected {
    font-weight: 700;
    color: green;
}

.matchup-topic-picker ul li img {
    max-width: 100%;
    max-height: 100px;
    width: auto !important;
    height: auto !important;
    display: inline-block;
}

.matchup-topic-picker ul li img.color-image {
    display: none;
}

.matchup-topic-picker ul li.is-selected img.mono-image {
    display: none;
}

.matchup-topic-picker ul li.is-selected img.color-image {
    display: inline-block;
}

.matchup-topic-picker ul li p {
    width: 100%;
    float: left;
    clear: both;
    text-align: center;
}

.matchup-topic-picker .number-to-find-line {
    display: none;
    float: left;
    width: 100%;
    clear: left;
    font-size: 30px;
    color: #000;
}

.matchup-topic-picker .number-to-find-line.is-shown {
    display: block;
}

.matchup-topic-picker .number-to-find-line .number-left-to-find {
    color: #FFF;
    display: inline-block;
}

.matchup-topic-picker .number-to-find-line .number-left-to-find.animate {
    -webkit-animation: numberLeft 1.2s ease-out;
	-moz-animation: numberLeft 800ms ease-out;
	-o-animation: numberLeft 800ms ease-out;
	animation: numberLeft 1.2s ease-out;
}

/** animation **/
@keyframes numberLeft {
    0% {
        transform:translateY(-100%);
        opacity: 0;
    }
    5% {
        transform:translateY(-100%);
        opacity: 0;
    }
    15% {
        transform:translateY(0);
        padding-bottom: 5px;
    }
    30% {
        transform:translateY(-50%);
    }
    40% {
        transform:translateY(0%);
        padding-bottom: 6px;
    }
    50% {
        transform:translateY(-30%);
    }
    70% {
        transform:translateY(0%);
        padding-bottom: 7px;
    }
    80% {
        transform:translateY(-15%);
    }
    90% {
        transform:translateY(0%);
        padding-bottom: 8px;
    }
    95% {
        transform:translateY(-7%);
    }
    97% {
        transform:translateY(0%);
        padding-bottom: 9px;
    }
    99% {
        transform:translateY(-3%);
    }
    100% {
        transform:translateY(0);
        padding-bottom: 9px;
        opacity: 1;
    }
}

.matchup-complete {
    position: fixed;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 30;
    align-items: center;
    padding: 0 5%;
    background-color: rgba(60, 60, 60, 0.2);
}

.matchup-complete-holder {
    position: relative;
}

.matchup-complete.is-shown {
    display: flex;
}

.matchup-complete img {
    max-width: 50%;
    max-height: 50%;
    float: left;
}

.matchup-complete .speech-bubble {
	position: relative;
	background: #FFF;
    box-sizing: border-box;
    padding: 12px;
	border-radius: .4em;
    max-width: 45%;
    margin-left: 5%;
}

.matchup-complete .speech-bubble h4 {
    font-size: 2em;
}

.matchup-complete .speech-bubble:after {
	content: '';
	position: absolute;
	left: 0;
	top: 50%;
	width: 0;
	height: 0;
	border: 20px solid transparent;
	border-right-color: #FFF;
	border-left: 0;
	border-top: 0;
	margin-top: -10px;
	margin-left: -20px;
}

/**
 * medium-small break point
 */
@media screen and (max-width: 42em) {
    .matchup-grid {
        width: 100%;
    }
    
    .matchup-topic-picker {
        width: 100%;
    }
}

/**
 * small break point
 */
@media screen and (max-width: 31.250em) { /** 500px **/
    .matchup-complete img {
        max-width: 85%;
    }
    
    .matchup-complete .speech-bubble {
        max-width: 95%;
        margin-top: 20px;
    }
}