@import url(http://fonts.googleapis.com/css?family=Roboto+Condensed:300);

html {
  font-family: 'Roboto Condensed', arial, sans-serif;
  height: 100%;
}

body {
  background: #000;
  height: 100%;
  margin: 0 auto;
  position: relative;
  padding: 0;
  text-align: center;
  width: 700px;
}

body:before {
  content: '';
  display: inline-block;
  height: 100%;
  margin-left: -10px;
  vertical-align: middle;
  width: 1px;
}

body > .logo {
  position: absolute;
  right: 20px;
  top: 20px;
  z-index: 10;
}

.carte {
  display: inline-block;
  font-size: 20px;
  height: 680px;
  margin: 0 auto;
  position: relative;
  vertical-align: middle;
  width: 700px;
}

.carte div {
  position: absolute;
}

.main-anim {
  height: 100%;
  left: 0;
  opacity: 1;
  top: -30px;
  width: 100%;
}

.hand {
  background: url('./images/hand.png') no-repeat 100%;
  bottom: 130px;
  height: 84px;
  left: 275px;
  opacity: 0;
  width: 139px;

  -webkit-transform: scale(0.8);
  transform: scale(0.8);
}

.rod {
  background: url('./images/rod.png') no-repeat 100%;
  bottom: 175px;
  height: 157px;
  left: 210px;
  opacity: 0;
  -webkit-transform-origin: 240px 80px;
  transform-origin: 240px 80px;
  width: 263px;
  z-index: 10;
}

.blink {
  background: url('./images/blink.png') no-repeat 100%;
  bottom: 285px;
  height: 70px;
  left: 195px;
  opacity: 0;
  width: 40px;
}

.phase {
  opacity: 1;
}

.phase-1-1 {
  background: url('./images/phase1-1.png') no-repeat 100%;
  height: 80px;
  /*width: 216px;*/
  width: 0;

  /*left: 150px;*/
  right: 334px;
  top: 338px;
}

.phase-1-2 {
  background: url('./images/phase1-2.png') no-repeat 0 100%;
  /*height: 151px;*/
  height: 0;
  /*width: 76px;*/
  width: 20px;

  left: 150px;
  /*top: 187px;*/
  bottom: 342px;
}

.phase-1-3 {
  background: url('./images/phase1-3.png') no-repeat;
  height: 166px;
  /*width: 53px;*/
  width: 0;

  left: 226px;
  top: 187px;
}

.phase-2-1 {
  background: url('./images/phase2-1.png') no-repeat;
  height: 112px;
  /*width: 199px;*/
  width: 0;

  left: 264px;
  top: 249px;
}

.phase-2-2 {
  background: url('./images/phase2-2.png') no-repeat 100%;
  height: 112px;
  /*width: 199px;*/
  width: 0;

  /*left: 264px;*/
  right: 237px;
  top: 137px;
}

.phase-3-1 {
  background: url('./images/phase3-1.png') no-repeat 0 0;
  /*height: 98px;*/
  height: 0;
  width: 40px;

  left: 297px;
  top: 169px;
}

.phase-3-2 {
  background: url('./images/phase3-2.png') no-repeat;
  height: 141px;
  /*width: 181px;*/
  width: 0;

  left: 297px;
  top:  220px;
}

.phase-3-3 {
  background: url('./images/phase3-3.png') no-repeat 100% 100%;
  /*height: 158px;*/
  height: 0;
  width: 141px;

  left: 337px;
  /*top: 62px;*/
  bottom: 460px;
}

.phase-4-1 {
  background: url('./images/phase4-1.png') no-repeat 0 0;
  /*height: 197px;*/
  height: 0;
  width: 92px;

  left: 255px;
  top: 63px;
}

.phase-4-2 {
  background: url('./images/phase4-2.png') no-repeat;
  height: 211px;
  /*width: 235px;*/
  width: 0;

  left: 255px;
  top: 169px;
}

.phase-5 {
  background: url('./images/phase5.png') no-repeat;
  height: 318px;
  width: 235px;

  left: 255px;
  top: 62px;

  opacity: 0;
}

.leaf {
  background: url('./images/leaf.png') no-repeat;
  height: 393px;
  left: 190px;
  top: 50px;
  width: 262px;
  opacity: 0;
}

.text, .final-text {
  bottom: 80px;
  color: #fff;
  height: 3em;
  line-height: 1.5em;
  opacity: 1;
  overflow: hidden;
  position: absolute;
  text-align: center;
  width: 100%;
}

.text p, .final-text p {
  height: 100%;
  margin: 0;
}


.text p:first-child {
  margin-top: -3em;
}

.final-text {
  opacity: 0;
}

.carte .logo {
  background: url('./images/logo-big.png') no-repeat;
  height: 196px;
  left: 50%;
  margin: -98px 0 0 -88px;
  top: 40%;
  width: 177px;

  -webkit-transform: scale(0);
  transform: scale(0);
}

.play-again {
  bottom: 200px;
  color: #fff;
  font-size: 1.5em;
  left: 50%;
  margin-left: -95px;
  position: absolute;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  width: 220px;
  opacity: 0;
}

.play-again:after {
  content: url('./images/play.png');
  display: inline-block;
  margin-left: 10px;
  vertical-align: middle;
}

.play-again:hover {
  -webkit-transform: scale(1.5);
  transform: scale(1.5);
}

@media (max-width: 700px) {
  .carte {
    font-size: 30px;
  }
}

/**
 * Animation
 */

.active .main-anim {
  opacity: 0;
  transition: 2s opacity 13s linear;
}

.active .hand {
  opacity: 1;
  transition: 2s opacity 0s linear;
}

.active .rod {
  opacity: 1;
  transition: 1.5s opacity 0s linear;

  -webkit-animation: rodmove 9s linear 3s; /* Chrome, Safari, Opera */
  animation: rodmove 9s linear 3s;
}

.active .blink {
  -webkit-animation: blink 2s linear 1s; /* Chrome, Safari, Opera */
  animation: blink 2s linear 1s;
}

.active .phase {
  opacity: 0.4;
}

.active .phase-1-1 {
  transition: 1.6s width 2.5s ease-in, 0.5s opacity 11.5s;
  width: 216px;
}

.active .phase-1-2 {
  transition: 1s 4s linear, 0.5s opacity 11.5s;
  height: 151px;
  width: 76px;
}

.active .phase-1-3 {
  transition: 1s width 5s linear, 0.5s opacity 11.5s;
  width: 53px;
}

.active .phase-2-1 {
  transition: 1s width 5.65s ease-in, 0.5s opacity 11.5s;
  width: 199px;
}

.active .phase-2-2 {
  transition: 1.4s width 6.4s linear, 0.5s opacity 11.5s;
  width: 199px;
}

.active .phase-3-1 {
  transition: 0.3s height 7.4s linear, 0.5s opacity 11.5s;
  height: 98px;
}

.active .phase-3-2 {
  transition: 1.1s width 7.6s linear, 0.5s opacity 11.5s;
  width: 181px;
}

.active .phase-3-3 {
  transition: 0.9s height 8.6s linear, 0.5s opacity 11.5s;
  height: 158px;
}

.active .phase-4-1 {
  transition: 1s height 9.4s linear, 0.5s opacity 11.5s;
  height: 197px;
}

.active .phase-4-2 {
  transition: 1.3s width 10.4s linear, 0.5s opacity 11.5s;
  width: 235px;
}

.active .phase-5 {
  transition: 0.5s opacity 11.5s;
  opacity: 1;
}

.active .leaf {
  transition: 0.5s opacity 12s;
  opacity: 1;
}

.active .text {
  opacity: 0;
  transition: 0.5s opacity 11.5s;
}

.active .text p:first-child {
  -webkit-animation: textroll 12.5s linear; /* Chrome, Safari, Opera */
  animation: textroll 12.5s linear;
}

.active .final-text {
  opacity: 1;
  transition: 0.5s opacity 11.4s;
}

.active .carte .logo {
  transition: 2s 13s;
  -webkit-transform: scale(1);
  transform: scale(1);
}

.active .play-again {
  transition: 0.5s, 1s opacity 15s;
  opacity: 1;
}


/* Chrome, Safari, Opera */
@-webkit-keyframes rodmove {
    0% { -webkit-transform: rotate(0); }
    5% { -webkit-transform: rotate(25deg) translate(-15px, -15px); }
    20% { -webkit-transform: rotate(0) translate(-20px, -20px); }
    25% { -webkit-transform: rotate(25deg) scale(0.8) translate(-15px, -35px); }
    30% { -webkit-transform: rotate(0) scale(0.9) translate(0px, -40px); }
    35% { -webkit-transform: rotate(45deg) translate(15px, -35px); }
    50% { -webkit-transform: rotate(0) scale(1.1) translate(20px, -20px); }
    55% { -webkit-transform: rotate(25deg) scale(1.2) translate(15px, -15px); }
    60% { -webkit-transform: rotate(0) translate(0px, 0px); }
    65% { -webkit-transform: rotate(45deg) scale(0.9) translate(-15px, -15px); }
    80% { -webkit-transform: rotate(0) scale(0.8) translate(-20px, -20px); }
    85% { -webkit-transform: rotate(45deg) translate(-15px, -30px); }
    90% { -webkit-transform: rotate(0) translate(-15px, -35px); }
    95% { -webkit-transform: rotate(25deg) translate(0px, -40px); }
    98% { -webkit-transform: rotate(0); }
}

/* Standard syntax */
@keyframes rodmove {
    0% { transform: rotate(0); }
    5% { transform: rotate(25deg) translate(-15px, -15px); }
    20% { transform: rotate(0) translate(-20px, -20px); }
    25% { transform: rotate(25deg) scale(0.8) translate(-15px, -35px); }
    30% { transform: rotate(0) scale(0.9) translate(0px, -40px); }
    35% { transform: rotate(45deg) translate(15px, -35px); }
    50% { transform: rotate(0) scale(1.1) translate(20px, -20px); }
    55% { transform: rotate(25deg) scale(1.2) translate(15px, -15px); }
    60% { transform: rotate(0) translate(0px, 0px); }
    65% { transform: rotate(45deg) scale(0.9) translate(-15px, -15px); }
    80% { transform: rotate(0) scale(0.8) translate(-20px, -20px); }
    85% { transform: rotate(45deg) translate(-15px, -30px); }
    90% { transform: rotate(0) translate(-15px, -35px); }
    95% { transform: rotate(25deg) translate(0px, -40px); }
    98% { transform: rotate(0); }
}


/* Chrome, Safari, Opera */
@-webkit-keyframes blink {
    0% { opacity: 0; }
    25% { opacity: 0.6; }
    50% { opacity: 0; }
    75% { opacity: 1; }
    100% { opacity: 0; }
}

/* Standard syntax */
@keyframes blink {
    0% { opacity: 0; }
    25% { opacity: 0.6; }
    50% { opacity: 0; }
    75% { opacity: 1; }
    100% { opacity: 0; }
}


/* Chrome, Safari, Opera */
@-webkit-keyframes textroll {
    0% { margin-top: 0; }
    37% { margin-top: 0; }
    40% { margin-top: -3em; }
    57% { margin-top: -3em; }
    60% { margin-top: -6em; }
    77% { margin-top: -6em; }
    80% { margin-top: -9em; }
    97% { margin-top: -9em; }
}

/* Standard syntax */
@keyframes textroll {
    0% { margin-top: 0; }
    37% { margin-top: 0; }
    40% { margin-top: -3em; }
    57% { margin-top: -3em; }
    60% { margin-top: -6em; }
    77% { margin-top: -6em; }
    80% { margin-top: -9em; }
    97% { margin-top: -9em; }
}
