/**
 * The MIT License (MIT)
 *
 * Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
/** chess cube style **/

#chesscube {
    margin: 1em auto;
    -webkit-perspective: 1200px;
    perspective: 1200px;
    position: fixed; 
    z-index: -100;
    bottom:100px;
    right: 100px; 
    width: 160px; 
    height: 160px;    
    transition: opacity 1s;
}

#spinner div {
    position: fixed;
    width: 160px;
    height: 160px;
    border: 1px solid #ccc;
    background: rgba(255,255,155,0.8);
    text-align: center;
    line-height: 160px;
    font-size: 120px;                
    -webkit-box-shadow: inset 0 0 40px rgba(0,0,0,0.4);
    box-shadow: inset 0 0 40px rgba(0,0,0,0.4);
}

#spinner div:nth-child(1) {
    -webkit-transform: translateZ(80px);
    transform: translateZ(80px);
}
#spinner div:nth-child(2) {
    -webkit-transform: rotateY(90deg) translateZ(80px);
    transform: rotateY(90deg) translateZ(80px);
}
#spinner div:nth-child(3) {
    -webkit-transform: rotateY(90deg) rotateX(90deg) translateZ(80px);
    transform: rotateY(90deg) rotateX(90deg) translateZ(80px);
}
#spinner div:nth-child(4) {
    -webkit-transform: rotateY(180deg) rotateZ(90deg) translateZ(80px);
    transform: rotateY(180deg) rotateZ(90deg) translateZ(80px);
}
#spinner div:nth-child(5) {
    -webkit-transform: rotateY(-90deg) rotateZ(90deg) translateZ(80px);
    transform: rotateY(-90deg) rotateZ(90deg) translateZ(80px);
}
#spinner div:nth-child(6) {
    -webkit-transform: rotateX(-90deg) translateZ(80px);
    transform: rotateX(-90deg) translateZ(80px);
}

@-webkit-keyframes spincube {
    from,to  {                                                    }            
    16%      { -webkit-transform: rotateY(-90deg);                }
    33%      { -webkit-transform: rotateY(-90deg) rotateZ(90deg); }
    50%      { -webkit-transform: rotateY(180deg) rotateZ(90deg); }
    66%      { -webkit-transform: rotateY(90deg) rotateX(90deg);  }
    83%      { -webkit-transform: rotateX(90deg);                 }
}

@keyframes spincube {
    from,to  {                                                    }            
    16%      { transform: rotateY(-90deg);                }
    33%      { transform: rotateY(-90deg) rotateZ(90deg); }
    50%      { transform: rotateY(180deg) rotateZ(90deg); }
    66%      { transform: rotateY(90deg) rotateX(90deg);  }
    83%      { transform: rotateX(90deg);                 }
}

#spinner {
    -webkit-animation-name: spincube;
    -webkit-animation-timing-function: ease-in-out;
    -webkit-animation-iteration-count: infinite;
    -webkit-animation-duration: 12s;
    -webkit-transform-style: preserve-3d;
    -webkit-transform-origin: 80px 80px 0;
    animation-name: spincube;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-duration: 12s;
    transform-style: preserve-3d;
    transform-origin: 80px 80px 0;
}

@media (max-width: 767px) {
    #chesscube {
        opacity: 0;
    }
}
