* {
  padding:0;
  margin:0;
}

/*
  it seems no-one implement yet, current default value is min-width: 980px
  if appliable, min-height can prevent card covered in non-enough height screen.
  http://dev.w3.org/csswg/css-device-adapt/
*/
@viewport {
  min-width: 760px;
  min-height: 530px;
}

a {
  outline: none;
  text-decoration:none;
  color: #DA4930;
}

body {
  text-align: center;
  background-color: #F26522;
  background: url(images/left.png) no-repeat bottom left fixed, url(images/right.png) no-repeat bottom right fixed, -moz-linear-gradient(0, rgba(200,0,0,.5) 50%, transparent 50%), -moz-linear-gradient(rgba(200,0,0,.5) 50%, transparent 50%), #F26522;
  background: url(images/left.png) no-repeat bottom left fixed, url(images/right.png) no-repeat bottom right fixed, -o-linear-gradient(0, rgba(200,0,0,.5) 50%, transparent 50%), -o-linear-gradient(rgba(200,0,0,.5) 50%, transparent 50%), #F26522;
  background: url(images/left.png) no-repeat bottom left fixed, url(images/right.png) no-repeat bottom right fixed, -webkit-linear-gradient(0, rgba(200,0,0,.5) 50%, transparent 50%), -webkit-linear-gradient(rgba(200,0,0,.5) 50%, transparent 50%), #F26522;
  background: url(images/left.png) no-repeat bottom left fixed, url(images/right.png) no-repeat bottom right fixed, linear-gradient(0, rgba(200,0,0,.5) 50%, transparent 50%), linear-gradient(rgba(200,0,0,.5) 50%, transparent 50%), #F26522;
  background-size: auto auto, auto auto, 50px 50px, 50px 50px, auto auto;
  color: #DA4930;
  font-family: "Days One", sans-serif;
}

:-moz-full-screen {
  background: url(images/left.png) no-repeat bottom left fixed, url(images/right.png) no-repeat bottom right fixed, -moz-linear-gradient(0, rgba(200,0,0,.5) 50%, transparent 50%), -moz-linear-gradient(rgba(200,0,0,.5) 50%, transparent 50%), #F26522;
  background-size: auto auto, auto auto, 50px 50px, 50px 50px, auto auto;
}

:-webkit-full-screen {
  background: url(images/left.png) no-repeat bottom left fixed, url(images/right.png) no-repeat bottom right fixed, -webkit-linear-gradient(0, rgba(200,0,0,.5) 50%, transparent 50%), -webkit-linear-gradient(rgba(200,0,0,.5) 50%, transparent 50%),  #F26522;
  background-size: auto auto, auto auto, 50px 50px, 50px 50px, auto auto;
}

#game {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: #001711;
  width: 760px;
  height: 530px;
  margin: auto;
  display: block;
  box-shadow: 0px 3px 12px #000;
  border-radius: 4px;
  padding: 20px;
}
#gameStats {
  background: #eee;
  width: 100%;
  float: left;
  box-shadow: inset 0 0 8px #000;
  border-radius: 4px;
  padding: 10px 0;
  height: 20px;
  font-size: 16px;
}

#qrcode {
  float: left;
  padding: 0 0 0 15px;
  cursor: pointer;
  position: relative;
  margin-right: 20px;
}

#gameScore, #reset {
  display: none;
  float: left;
  text-align: left;
  padding: 0 0 0 15px;
}

#reset {
  cursor: pointer;
}

#qrcode:before, #credit:before {
  position: absolute;
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 8px;
  background-color: #000;
  box-shadow: inset 0 0 3px #ddd;
  top: 2px;
}

#qrcode:before {
  right: -25px;
}

#qrcode:after, #credit:after {
  position: absolute;
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background-color: #ddd;
  box-shadow: 0 0 2px #fff;
  top: 7px;
}

#qrcode:after {
  right: -20px;
}

.baritem, #credit {
  display: none;
  float: right;
  text-align: right;
  margin: 0 10px 0 30px;
  cursor: pointer;
  position: relative;
}

.baritem:before {
  position: absolute;
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 8px;
  background-color: #000;
  box-shadow: inset 0 0 3px #DA4930;
  top: 2px;
  left: -25px;
}

.baritem:after {
  position: absolute;
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 3px #ddd;
  top: 2px;
  left: -25px;
}

#mute.melody:before {
  background-color: rgba(218, 73, 48, 1);
  box-shadow: 0 0 5px rgba(218, 73, 48, 0.7);
}

:fullscreen #fullscreen:before {
  background-color: rgba(218, 73, 48, 1);
  box-shadow: 0 0 5px rgba(218, 73, 48, 0.7);
}

:-moz-full-screen #fullscreen:before {
  background-color: rgba(218, 73, 48, 1);
  box-shadow: 0 0 5px rgba(218, 73, 48, 0.7);
}

:-webkit-full-screen #fullscreen:before {
  background-color: rgba(218, 73, 48, 1);
  box-shadow: 0 0 5px rgba(218, 73, 48, 0.7);
}

#credit {
  display: block;
}

#credit:before {
  left: -25px;
}

#credit:after {
  left: -20px;
}

#game.play #gameScore, #game.play #reset, #mute.music, #fullscreen.support {
  display: block;
}

#playground {
  margin-top: 58px;
  position: relative;
  height: 500px;
}

#cards {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  display: none;
  z-index: 2;
}

#game.play #cards {
  display: block;
}

/* Define the 3D perspective view and dimension of each card. */
.card {
  -webkit-perspective: 600px;
  -moz-perspective: 600px;
  width: 110px;
  height: 145px;
  position: absolute;
  -moz-transition: all .3s ease;
  -webkit-transition: all .3s ease;
  -o-transition: all .3s ease;
  transition: all .3s ease;
  cursor: pointer;
}

.reset {
  box-shadow: 0 0 30px #fff;
}

#gameIntro {
  padding-top: 10px;
  text-align: center;
  height: 480px;
  width: 760px;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  -moz-transition: opacity 1s ease-out;
  -webkit-transition: opacity 1s ease-out;
  -o-transition: opacity 1s ease-out;
  transition: opacity 1s ease-out;
}

#game.open #gameIntro {
  opacity: 1;
  z-index: 3;
  background: url(./images/start.png) center center no-repeat;
}

#game.play #gameIntro, #game.end #gameIntro {
  opacity: 0;
  z-index: 0;
  background: url(./images/start.png) center center no-repeat;
}

#gamePlay {
  background: white;
  border-radius: 5px;
  display: block;
  font-size: 2em;
  margin: 350px auto 0;
  padding: 10px;
  width: 150px;
  border: 8px solid #DA4930;
  z-index: 99;
}

#gamePlay:hover, .button:hover {
  background: #F26522 !important;
  color: #fff;
  cursor: pointer;
}

#loading.loaded {
  display: none;
}

#gameComplete {
  background: url(./images/end.png) center 0 no-repeat;
  text-align: center;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  width: 760px;
  height: 400px;
  visibility: hidden;
  z-index: 1;
}

#game.end #gameComplete {
  opacity: 1;
  z-index: 3;
  visibility: visible;
  top: 0;
  bottom: 0;
}

#gameComplete a.share-button {
  display: inline-block;
  font-size: 11px;
  margin-right: 10px;
  padding: 1px 10px;
  line-height: 16px;
  height: 16px;
  border-radius: 3px;
  color: #FFFFFF;
  font-weight: bold;
  vertical-align: middle;
}

#gameComplete a.facebook-share-button {
  background: #336699;
  border: 1px solid #003366;
}
#gameComplete a.plurk-share-button {
  background: #CC6633;
  border: 1px solid #993300;
}
#gameComplete .twitter-share-button {
  vertical-align: middle;
  display: inline-block;
  font-size: 11px;
}

#gameComplete a.button {
  background: white;
  border-radius: 5px;
  display: block;
  font-size: 30px;
  margin: 8px auto 0;
  padding: 10px;
  width: 200px;
  border: 8px solid #DA4930;
  text-decoration:none;
}

#result {
  background: white;
  margin: 290px auto 0;
  width: 60%;
  border-radius: 5px;
  font-size: 20px;
  border: 8px solid #DA4930;
  padding: 20px 0;
  position: relative;
}

#result:before {
  content: ' ';
  position: absolute;
  width: 0;
  height: 0;
  left: 140px;
  top: -50px;
  border: 25px solid;
  border-color: transparent #DA4930 #DA4930 transparent;
}

#result:after {
  content: ' ';
  position: absolute;
  width: 0;
  height: 0;
  left: 142px;
  top: -30px;
  border: 20px solid;
  border-color: transparent #fff #fff transparent;
}

.face {
  width: 100%;
  height: 100%;
  position: absolute;
  -webkit-transition-property: opacity, transform, box-shadow;
  -webkit-transition-duration: .5s;
  -webkit-backface-visibility: hidden;
  -moz-transition-property: opacity, -moz-transform, box-shadow;
  -moz-transition-duration: .5s;
  -moz-backface-visibility: hidden;
  -o-transition-property: opacity, -o-transform, box-shadow;
  -o-transition-duration: .5s;
  -o-backface-visibility: hidden;
}

.front {
  background: url(./images/card.png) 0 0;
  z-index: 10;
  border-radius: 4px;
}
.back {
  -webkit-transform: rotate3d(0,1,0,-180deg);
  -moz-transform: rotate3d(0,1,0,-180deg);
  z-index: 8;
  border-radius: 4px;
}
.face::after {
  content: "";
  display: block;
  height: 100%;
  -webkit-transition-property: opacity, transform, box-shadow;
  -webkit-transition-duration: .5s;
  -webkit-backface-visibility: hidden;
  -moz-transition-property: opacity, -moz-transform, box-shadow;
  -moz-transition-duration: .5s;
  -moz-backface-visibility: hidden;
  -o-transition-property: opacity, -o-transform, box-shadow;
  -o-transition-duration: .5s;
  -o-backface-visibility: hidden;
  width: 100%
}
.card:hover .face::after {
  box-shadow: 0 0 10px #ccc;
  opacity: 1;
}
.card.card-flipped .face::after {
  display: none;
}
.card-flipped .face {
  box-shadow: 0 0 10px #ccc;
}

.card-flipped .front {
  -webkit-transform: rotate3d(0,1,0,180deg) scale(1.1);
  -moz-transform: rotate3d(0,1,0,180deg) scale(1.1);
  -o-transform: scale(1.1);
  z-index: 8;
}
.card-flipped .back {
  -webkit-transform: rotate3d(0,1,0,0deg) scale(1.1);
  -moz-transform: rotate3d(0,1,0,0deg) scale(1.1);
  -o-transform: scale(1.1);
  z-index: 10;
}
.card-removed {
  opacity: 0;
}

#splash {
  z-index: 90;
  -moz-transition: all .8s ease-in 1.2s;
  -webkit-transition: all .8s ease-in 1.2s;
  -o-transition: all .8s ease-in 1.2s;
  transition: all .8s ease-in 1.2s;
  top: -300%;
  bottom: 300%;
  position: fixed;
  margin: auto 0;
  width: 100%;
  height: 400px;
  background-color: rgba(255, 255, 255, 0.7);
  background-clip: padding-box;
  border-top: 8px solid rgba(218, 73, 48, 0.7);
  border-bottom: 8px solid rgba(218, 73, 48, 0.7);
  box-shadow: 0 0 30px #fff;
  padding: 10px 0;
  opacity: 0;
  -moz-transform: scale(3);
  -webkit-transform: scale(3);
  -o-transform: scale(3);
  transform: scale(3);
  pointer-events:none;

}

#splash.disable {
  display: none;
}

#splash.match  {
  top: 0;
  bottom: 0;
  opacity: 1;
  -moz-transition: all .8s ease .2s;
  -webkit-transition: all .8s ease .2s;
  -o-transition: all .8s ease .2s;
  transition: all .8s ease .2s;
  -moz-transform: scale(1);
  -webkit-transform: scale(1);
  -o-transform: scale(1);
  transform: scale(1);
}

#splash:target  {
  top: 0;
  bottom: 0;
  opacity: 1;
}

#splash span {
  position: relative;
  display: inline-block;
  max-width: 100%;
  vertical-align: bottom;
  background-color: #fff;
  padding: 5px 0;
  margin: 0 18px;
  border-radius: 5px;
  box-shadow: 0 0 10px #000;
  pointer-events:none;
}

#splash p {
  padding: 15px 0;
}

#splash span:after {
  content: ' ';
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.8);
  box-shadow: inset 0 0 1px rgba(255,255,255,.4), inset 0 1px 0 rgba(255,255,255,.4), 0 1px 2px rgba(0,0,0,.3);
  border-radius: 5px;
  opacity: 1;
}

#splash span.current {
  z-index: 95;
  -moz-transition: all .8s ease 0;
  -webkit-transition: all .8s ease 0;
  -o-transition: all .8s ease 0;
  transition: all .8s ease 0;
  box-shadow: 0 0 20px #000;
  -moz-transform: rotate(5deg) scale(2);
  -webkit-transform: rotate(5deg) scale(2);
  -o-transform: rotate(5deg) scale(2);
  transform: rotate(5deg) scale(2);
}

#splash.match span.current {
  -moz-transition: all .8s linear .8s;
  -webkit-transition: all .8s linear .8s;
  -o-transition: all .8s linear .8s;
  transition: all .8s linear .8s;
  -moz-transform: rotate(-5deg) scale(4);
  -webkit-transform: rotate(-5deg) scale(4);
  -o-transform: rotate(-5deg) scale(4);
  transform: rotate(-5deg) scale(4);
}

#splash span.matched:after {
  opacity: 0;
}

#splash img {
  vertical-align: bottom;
  margin: 0 5px;
  height: 150px;
}

.lightbox a {
  color: #F26522;
}

.lightbox:after {
  -moz-transition: opacity .8s ease;
  -webkit-transition: opacity .8s ease;
  -o-transition: opacity .8s ease;
  transition: opacity .8s ease;
  content: "";
  position: fixed;
  top: 0;
  left: -200%;
  bottom: 0;
  background: rgba(0,0,0,0.8);
  opacity: 0;
}

.lightbox > div {
  -moz-transition: opacity .8s ease;
  -webkit-transition: opacity .8s ease;
  -o-transition: opacity .8s ease;
  transition: opacity .8s ease;
  position: absolute;
  width: 760px;
  height: 520px;
  padding: 1em;
  margin: auto;
  top: 0;
  bottom: 0;
  left: -100%;
  background-color: #fff;
  border-radius: 5px;
  border: 8px solid #DA4930;
  opacity: 0;
  overflow-y: auto;
}

.lightbox:target {
  left: 0;
}

.lightbox:target > div {
  left: 0;
  right: 0;
  opacity: 1;
  z-index: 100;
}

.lightbox:target::after {
  left: 0;
  right: 0;
  opacity: 1;
  z-index: 99;
}

.lightbox p {
  font-size: 1.5em;
  margin: .5em;
}

.ie {background: url(./images/ie.png) no-repeat -5px -15px;}
.fx {background: url(./images/fx.png) no-repeat -5px -15px;}
.cr {background: url(./images/cr.png) no-repeat -5px -15px;}
.sf {background: url(./images/sf.png) no-repeat -5px -15px;}
.op {background: url(./images/op.png) no-repeat -5px -15px;}
.ns {background: url(./images/ns.png) no-repeat -5px -15px;}
.ms {background: url(./images/ms.png) no-repeat -5px -15px;}
.tb {background: url(./images/tb.png) no-repeat -5px -15px;}
.fm {background: url(./images/fm.png) no-repeat -5px -15px;}
.ie-icon {background: url(./images/icon_ie.png) no-repeat -5px -20px;}
.fx-icon {background: url(./images/icon_fx.png) no-repeat -5px -20px;}
.cr-icon {background: url(./images/icon_cr.png) no-repeat -5px -20px;}
.sf-icon {background: url(./images/icon_sf.png) no-repeat -5px -20px;}
.op-icon {background: url(./images/icon_op.png) no-repeat -5px -20px;}
.ns-icon {background: url(./images/icon_ns.png) no-repeat -5px -20px;}
.ms-icon {background: url(./images/icon_ms.png) no-repeat -5px -20px;}
.tb-icon {background: url(./images/icon_tb.png) no-repeat -5px -20px;}
.fm-icon {background: url(./images/icon_fm.png) no-repeat -5px -20px;}


/* AppCache UI */

#appcache_info {
  position: absolute;
  position: fixed;
  top: -2em;
  left: 1em;
  right: 1em;
  font: 1em sans-serif;
  line-height: 1.8em;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  overflow: hidden;

  background-color: rgba(245, 245, 245, 0.9);
  color: #000;
  border: 1px solid #ccc;
  -webkit-box-shadow: 0 0 5px #e0e0e0;
  box-shadow: 0 0 5px #e0e0e0;
  border-top: none;

  padding: 0 0.5em;
  border-bottom-left-radius: 0.25em;
  border-bottom-right-radius: 0.25em;

  -webkit-transition: top 0.5s ease;
  -moz-transition: top 0.5s ease;
  -ms-transition: top 0.5s ease;
  -o-transition: top 0.5s ease;
  transition: top 0.5s ease;
  z-index: 99999;
}

#appcache_info a {
  display: none;
  float: right;
  font-weight: bold;
  text-decoration: none;
  color: #00f;
}

#appcache_info.appcache-progress:after {
  display: block;
  float: right;
  font-weight: bold;
  content: attr(data-progress);
}

#appcache_info.appcache-updateready a,
#appcache_info.appcache-obsolete a {
  display: block;
}

body.appcache-allinfo #appcache_info.appcache-checking,
#appcache_info.appcache-downloading,
#appcache_info.appcache-progress,
#appcache_info.appcache-updateready,
#appcache_info.appcache-obsolete {
  top: 0;
}

#appcache_info.appcache-updateready,
#appcache_info.appcache-obsolete {
  background-color: rgba(255, 245, 128, 0.9);
  font-weight: bold;
}

body.appcache-allinfo #appcache_info.appcache-noupdate,
body.appcache-allinfo #appcache_info.appcache-error,
#appcache_info.appcache-cached {
  top: -2em;

  -webkit-transition: top 0.5s ease 3s;
  -moz-transition: top 0.5s ease 3s;
  -ms-transition: top 0.5s ease 3s;
  -o-transition: top 0.5s ease 3s;
  transition: top 0.5s ease 3s;
}

/* English (default) strings */
#appcache_info a:before {
  content: 'Reload Now';
}
#appcache_info.appcache-checking:before {
  content: 'Checking for offline content updates ...'
}
#appcache_info.appcache-downloading:before,
#appcache_info.appcache-progress:before {
  content: 'Downloading offline content ...'
}
#appcache_info.appcache-updateready:before {
  content: 'A new version is available.';
}
#appcache_info.appcache-noupdate:before {
  content: 'No updates available for now.';
}
#appcache_info.appcache-obsolete:before {
  content: 'This website is obsolete. Reload to see new version.';
}
#appcache_info.appcache-error:before {
  content: 'Unable to check for offline content updates.';
}
#appcache_info.appcache-cached:before {
  content: 'Download complete. Ready to be accessed offline.';
}
