﻿/*Стили и анимация для игры с нейросетью в "11 спичек"*/
/*на CSS*/
/*Версия 2.2*/
/*(с) Алексей Мальский (Sithoid)*/

/* DEFAULTS */

html {
  border:0;
  margin:0;
  padding:0px;}

body {
    background: -webkit-linear-gradient(#222222, #9f9fcc); /* For Safari 5.1 to 6.0 */
    background: -o-linear-gradient(#222222, #9f9fcc); /* For Opera 11.1 to 12.0 */
    background: -moz-linear-gradient(#222222, #9f9fcc); /* For Firefox 3.6 to 15 */
    background: linear-gradient(#222222, #9f9fcc); /* Standard syntax */
    overflow: hidden;
    margin: 5px;
    padding: 0px;
    font-size: 2vw;
    font-family: "Roboto Slab", sans-serif;
    height: 100%;
    box-sizing: border-box;
}

p {
    padding: 0;
    margin: 0px;
    color: #000000;
    text-align:center;
}

a:link {
    color: #0a87f2;
    text-decoration: underline;
}

a:visited {
    color: #1e73be;
    text-decoration: none;
}

a:hover {
    text-decoration:underline;
    color:#fff;
    background:#1e73be;
}

.bland:hover {
    text-decoration:none;
    background:none;
}

input[type=text] {
	background-color:rgba(255,255,255,0.5);
	border:2px solid rgba(128,128,128,0.7);
	border-radius:4px;
	font-size:1em;
	font-family: "Roboto Slab", sans-serif;
	padding-left:5px;
	color:#cc6600;
}

input[type=text]:focus {
	background-color:rgba(255,255,255,0.7);
	border:2px solid rgba(0,0,0,0.7);
}

/* LOADER ANIMATION */

#loader {
  padding:2.5%;
  position: absolute;
  left: 45%;
  top: 45%;
  z-index: 1;
  margin: -75px 0 0 -75px;
  border-radius: 50%;
  background-color:rgba(255,255,255,0.7);
  -webkit-animation: spin 1.5s linear infinite;
  animation: spin 1.5s linear infinite;
}

@-webkit-keyframes spin {
  0% { -webkit-transform: rotate(0deg); }
  100% { -webkit-transform: rotate(360deg); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#logo img {
  position: absolute;
  left:35%;
  top:75%;
  width:30vw;
  height:auto;
  margin:0;
}

/*TOOLTIP*/

.tooltip {
  position: fixed;
  right: 10px;
  top: 10px;
  z-index: 10;
}

.tooltip img {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  height: 3.5vw;
  width: 3.5vw;
  padding: 0.5vw;
}

/* Tooltip text */
.tooltip .tooltiptext {
    width: 25vw;
    background-color: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 0.7em;
    text-align: center;
    padding: 10px;
    border-radius: 6px;
 
    /* Position the tooltip text */
    position: absolute;
    z-index: 20;
    top: 10px;
    right: 110%;
    opacity: 0;
    transition: opacity 1s;
}

/* Show the tooltip text when you mouse over the tooltip container */
.tooltip:hover .tooltiptext {
    opacity: 1;
}

.tooltip .tooltiptext::after {
    content: " ";
    position: absolute;
    top: 25%;
    left: 100%; /* To the right of the tooltip */
    margin-top: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent transparent rgba(0,0,0,0.7);
}

/* MENU ANIMATION */

.animate-bottom {
  position: relative;
  -webkit-animation-name: animatebottom;
  -webkit-animation-duration: 1s;
  animation-name: animatebottom;
  animation-duration: 1s;
  width: 100%;
  height: 85%;
  margin: 0px;
  text-align: center;
  vertical-align: middle;
  background: rgba(240, 210, 180, 0.6);
  border-radius: 4px;
}

@-webkit-keyframes animatebottom {
  from { bottom:-100px; opacity:0 } 
  to { bottom:0px; opacity:0.6 }
}

@keyframes animatebottom { 
  from{ bottom:-100px; opacity:0 } 
  to{ bottom:0px; opacity:0.6 }
}

/* MENU TEXT */

.animate-bottom p {
  position: relative;
  margin: auto;
  padding: 20px;
  padding-top:0;
}

.animate-bottom h1 {
  position: relative;
  margin: auto;
  padding: 20px;
  font-size:2em;
}

.finetext {
    font-size: 0.75em;
    bottom:0;
}

/* BUTTONS ANIMATION */

.animate-fadein {
  -webkit-animation-name: animatefadein;
  -webkit-animation-duration: 1s;
  animation-name: animatefadein;
  animation-duration: 1s;
}

@-webkit-keyframes animatefadein {
  from { opacity:0 } 
  to { opacity:1 }
}

@keyframes animatefadein { 
  from{ opacity:0 } 
  to{ opacity:1 }
}

/* BUTTONS */

.user-interface {
    position: fixed;
    z-index: 100;
    margin:0px;
    margin-top:5px;
    vertical-align:middle;
    height: 15%;
    padding:0px;
}

.button {
  position: fixed;
  width: 40%;
  height:12%;
  border: none;
  border-radius: 4px;
  background-color: #1e73be;
  text-align: center;
  vertical-align: middle;
  font-size: 2em;
  font-family: "Roboto Slab";
  color: #ffffff;
  transition: all 0.5s;
  cursor: pointer;
  padding:0px;
  margin: 0px;
  bottom:5px;
}

.button:hover {
  background-color: #ff9900;
  transition: 0.5s;
}

.button:disabled {
  opacity: 0.3;
  pointer-events: none;
}

.fullscreen {
  position: fixed;
  left: 10px;
  top: 10px;
  z-index: 10;
}

.fullscreen button {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  height: 4.5vw;
  width: 4.5vw;
  border:none;
  padding: 0px;
  text-align: center;
  vertical-align: middle;
  font-size: 2em;
  opacity:0.7;
}

.corner:hover {
  -webkit-filter: invert(1);
   filter: invert(1);
  transition: all 0.5s;
}

.social:hover {
  color: #ff9900;
  transition: 0.5s;
}

/* make the video stretch to fill the screen in WebKit */
    :-webkit-full-screen body {
      width: 100%;
      height: 100%;
    }

/* GAME SCREEN AND EVENTS */

#myCanvas {
    position: relative;
    width: 100%;
    height: 85%;
    text-align: center;
    background: rgba(240,210,180,0.6);
    border-radius:4px;
}

/* Game grid */
.gamecell {
  position: relative;
  display: inline-block;
  vertical-align:top;
  border-width:0px;
/*Вся магия адаптивного дизайна - в пяти строчках!*/
  margin: 1%;
  width: 13%;
  height: 45%;
  min-width: 13vh;
  max-height: 35vw;
}

/*Text above the 0th match*/
.zerotext {
  position: absolute;
  width:100%;
  height:75%;
  margin: 0 auto;
  left: 0;
  right: 0;
  bottom: 13%;
}

/* CUPS/BOXES */

.boxStatic {
  position: absolute;
  width: 80%;
  height: 60%;
  margin: 0 auto;
  left: 0;
  right: 0;
  bottom: 15%;
  font-size: 50px;
  border-radius:25%;
  background-color: #bb7700;
  border: 5px solid #333333;
}

.boxDynamic {
  position: relative;
  animation: animbox 0.2s linear 0s 6 alternate;
  -webkit-animation-name: animbox;
  -webkit-animation-duration: 0.2s;
}

@-webkit-keyframes animbox {
  from { bottom:0px; transform:rotate(0deg); } 
  to { bottom:200px; transform:rotate(20deg); }
}

@keyframes animbox { 
  from{ bottom:0px; transform:rotate(0deg); } 
  to{ bottom:200px; transform:rotate(20deg); }
}

/*STONES*/

.stone {
  position: absolute;
  width: 4vw;
  height: 4vw;
  border: none;
  border-radius: 50%;
  margin:auto;
  bottom:5%;
  left:0px;
  right:0px;
  font-size:3vw;
  opacity: 0.7;
}

.swhite {
  background-color: #ffffff;
  color: #000000;
  bottom:50%;
}

.sblack {
  background-color: #000000;
  color: #ffffff;
}

.jumper {
  animation: animjump 1s ease-out;
  animation-fill-mode: forwards;
  -webkit-animation-name: animjump;
  -webkit-animation-duration: 1s;
}

@-webkit-keyframes animjump {
  from { bottom:5%; } 
  to { bottom:110%; }
}

@keyframes animjump { 
  from{ bottom:5%; } 
  to{ bottom:110%; }
}

/*MATCHES (STICKS)*/

.stick {
  position: absolute;
  width: 100%;
  height: 9%;
  border-radius:15%;
  margin:auto;
  bottom:0px;
  left:0px;
  right:0px;
  box-shadow: 2px 2px;
    background: #dd9900; /* In case the gradient doesn't work */
    background: -webkit-linear-gradient(#dd9900, #aa6600); /* For Safari 5.1 to 6.0 */
    background: -o-linear-gradient(#dd9900, #aa6600); /* For Opera 11.1 to 12.0 */
    background: -moz-linear-gradient(#dd9900, #aa6600); /* For Firefox 3.6 to 15 */
    background: linear-gradient(#dd9900, #aa6600); /* Standard syntax */
}

.aisnatch {
  animation: animaisnatch 1s ease-out 0.5s;
  animation-fill-mode: forwards;
  -webkit-animation-name: animaisnatch;
  -webkit-animation-duration: 1s;
}

@-webkit-keyframes animaisnatch {
  from { bottom:5px; opacity:1; } 
  to { bottom:100px; opacity:0; }
}

@keyframes animaisnatch { 
  from{ bottom:5px; opacity:1; } 
  to{ bottom:100px; opacity:0; }
}

.usersnatch {
  animation: animusersnatch 1s ease-out 0.5s;
  animation-fill-mode: forwards;
  -webkit-animation-name: animusersnatch;
  -webkit-animation-duration: 1s;
}

@-webkit-keyframes animusersnatch {
  from { bottom:5px; opacity:1; } 
  to { bottom:-90px; opacity:0; }
}

@keyframes animusersnatch { 
  from{ bottom:5px; opacity:1; } 
  to{ bottom:-90px; opacity:0; }
}

/*WIN & LOSE*/

.winmessage {
  top:35%;
  right:0;
  position: fixed;
  width:100%;
  height:100%;
  vertical-align: middle;
  text-align:center;
  font-size:2em;
  color:#bb5500;
  animation: aniwin 1.6s ease-out 0s 2 alternate;
  -webkit-animation-name: aniwin;
  -webkit-animation-duration: 1.6s;
}

@-webkit-keyframes aniwin {
  from {opacity:0; } 
  to { opacity:1; }
}

@keyframes aniwin { 
  from{ opacity:0; } 
  to{ opacity:1; }
}

/* LEARNING */

.shiny {
  bottom: 110%;
  animation: anishiny 0.5s ease-out 0s 4 alternate;
  -webkit-animation-name: anishiny;
  -webkit-animation-duration: 0.5s;
}

@-webkit-keyframes anishiny {
  from { height: 4vw; width: 4vw; font-size: 3vw; } 
  to { height: 4.5vw; width: 4.5vw; font-size: 3.5vw; color: #ff9900;}
}

@keyframes anishiny { 
  from { height: 4vw; width: 4vw; font-size: 3vw; } 
  to { height: 4.5vw; width: 4.5vw; font-size: 3.5vw; }
}

.gtfo {
  animation: anigtfo 1.5s ease-out;
  animation-fill-mode: forwards;
  -webkit-animation-name: anigtfo;
  -webkit-animation-duration: 1.5s;
}

@-webkit-keyframes anigtfo {
  from { bottom:110%; opacity:0.7; } 
  to { bottom:150%; opacity:0; }
}

@keyframes anigtfo { 
  from{ bottom:110%; opacity:0.7; } 
  to{ bottom:150%; opacity:0; }
}