/* Setup's body */

@keyframes bg-motion-left-right {
    0%{background-position:0 0, 0% 0}
    100%{background-position:0 0, 12.5% 0}
}
#setup
{
  display: none;
  position: fixed;
  width: 100vw;
  height: 100vh;
  z-index: -99999;
  background: linear-gradient( to right, #000, transparent 40% ), linear-gradient( 45deg, #777 1px, transparent 0 );
    background-position-x: 0%, 0%;
    background-position-y: 0%, 0%;
    background-size: auto, auto;
    background-size: 100% 100%, 40px 40px;
    background-position: 0 0, 30px 30px;

}
#setup.show
{
	display: block;
    animation: bg-motion-left-right 5s ease-in-out infinite;
    animation-direction: alternate;
}

/* Setup's primary wrapper, which is a centered-block (main.css) */

#wrapper-setup
{
  text-align: center;
}

/* The globe background layer */

@keyframes state-canvas-intro
{
  0% { opacity: 0 }
  100% { opacity: 50% }
}
#globe
{
	position:absolute;
	top: 50%;
	left: 50%;
	transform-origin: center;
}
canvas#c
{
  display: block;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate( -50%, -50% );
  opacity: 0;
  animation: state-canvas-intro 2s 1.4s linear;
  animation-fill-mode: forwards;
}

/* The logo and welcome text. */

@keyframes stage-logo-welcome-blink
{
  0% { opacity: 100% }
  2% { opacity: 0 }
  6% { opacity: 0 }
  8% { opacity: 100% }
  10% { opacity: 0 }
  20% { opacity: 100% }
  100% { opacity: 100% }
}
#setup-welcome > span
{
  color: #8c8c8c;
}
#setup-logo,
#setup-welcome
{
  opacity: 0;
  animation: stage-logo-welcome-blink 2s 1s linear infinite;
}
#setup-welcome
{
  animation-delay: 1.4s;
}


/* The grid used for the blinker and form. */

@keyframes stage-grid-blink-column-change
{
 0%{ width: 20px; grid-template-columns: 20px 0px;}
 99.9%{ width: 20px; grid-template-columns: 20px 1fr;}
 100%{grid-template-columns: 0 1fr;}
}
#wrapper-setup .grid
{
  margin: 5px auto 0 auto;
  grid-template-columns: 0 1fr;
  animation-name: stage-grid-blink-column-change;
  animation-duration: 0.7s;
  animation-timing-function: linear;
}


/* The first blinking bar that users see. */

@keyframes stage-initial-blinker-blink
{
  from{ visibility: visible}
  to{ visibility: hidden }
}
#initial-blinker
{
  position: relative;
  overflow: hidden;
  animation-name: fade;
  animation-duration: 0.5s;
  animation-timing-function: linear;
}
#initial-blinker > div
{
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url( "../i/bg-stripes-pixel.png" );
  background-repeat: repeat;
  animation: stage-initial-blinker-blink 0.1s steps(2, start) 2;
  animation-delay: 0.5s;
}

/* The setup form itself */

@keyframes stage-setup-form-intro{
  0% { width: 0; }
  70% { width: 0; }
  100% { width: 250px; }
}
#setup-form
{
  animation-name: stage-setup-form-intro;
  animation-duration: 1.2s;
  animation-timing-function: linear;
  overflow: hidden;
}

/* Tech border */

#setup-form .tech-border
{
  padding: 2px;
  background: #2ce9f2;
}
#setup-form .tech-border > div
{
  background: repeating-linear-gradient( -45deg, transparent 4px, #060 0, #060 6px, transparent 0, transparent 9px ),
    linear-gradient( rgba( 0, 0, 0, 0.5 ) 1px, rgba( 0, 200, 255, 0.1 ) 2px ), linear-gradient( to right, transparent 9px, #040 ), linear-gradient( #001 9px, #040 );
  background-size: 296px 7px, 100% 2px, 10px 10px, 10px 10px;
  background-position: 99.5% calc( 100% - 3px ), 0 0, 0 0, 0 0;
  background-repeat: no-repeat, repeat, repeat, repeat;
  padding: 10px 20px 20px 15px;
  overflow: hidden;
}

/* The Setup controls UI (enable sounds/music) */

.setup-stage-success-blink
{
  opacity: 0;
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba( 255, 255, 255, 0.5 );
  animation-name: fade, hide;
  animation-direction: reverse, normal;
  animation-duration: 0.2s, 0.01s;
  animation-timing-function: linear, linear;
  animation-delay: 1.2s, 1.4s;
}

.setup-row,
.setup-row label,
.setup-row button
{
  white-space: nowrap;
  overflow: none;
  text-overflow: none;
}
.setup-row:not(:last-child)
{
 margin-bottom: 5px;
}
.setup-row label
{
  display: grid;
  width: 100%;
  grid-template-columns: 0px 10px 1fr;
}
.setup-row .label-text
{
  display: block;
  width: 100%;
  border: 2px solid #aaa;
  padding: 3px 3px 3px 5px;
  cursor: pointer;
  line-height: 2rem;
  user-select: none;
  background: rgba( 200, 200, 200, 0.3 );
  color: #ccc;
  transition: all 0.2s;
}
.setup-row input:checked ~ .label-text
{
  border-color: #0d4;
  background: rgba( 0, 255, 0, 0.3 );
  color: #fff;
}
.setup-row div.label-text:hover
{
  text-transform: uppercase;
  border-color: #ddd;
  background: rgba( 220, 220, 220, 0.4 );
  color: #ccc;
  text-shadow: 2px 2px 1px #000;
}
.setup-row input:checked ~ div.label-text:hover
{
  border-color: #04d;
  background: rgba( 0, 100, 255, 0.4 );
  color: #3d3;
}
.setup-row div.label-text::after
{
  content:'Off';
}
.setup-row input:checked ~ div.label-text::after
{
  content:'On';
}

.setup-row input {
    visibility: hidden;
    cursor: pointer;
}
#setup-form .checkbox
{
  display: inline-block;
  margin-right: 2px;
  background: #c33;
}
#setup-form input:checked~.checkbox
{
  background: #0d4;
}

/* Submit button */

@keyframes state-button-hover
{
  0% { background-color: #f00;}
  100% { background-color: #400; }
}
.setup-row button
{
  width: 100%;
  /*background: url( '../i/bg-door-enter.png' ) 6px 50% no-repeat, #300;*/
  background: #300;
  border: 1px solid #c33;
  color: #f33;
  cursor: pointer;
}
.setup-row button:hover
{
  border-color: #f00;
  background: url( '../i/bg-door-enter-animated.gif' ) 6px 50% no-repeat, #400;
  animation: state-button-hover 0.5s linear;
  color: #fff;
  font-weight: 800;
}

/* Changes made after jumping. */

@keyframes state-jumped-scale-fade
{
  0% { opacity: 1; transform: scale(1); }
  60% { opacity: 0; }
  100% { transform: scale( 10 ); opacity: 0; display: none; }
}
@keyframes state-jumped-rotate
{
	0%{ transform: rotateZ( 0deg ); }
	100%{ transform: rotateZ( 80deg ); }
}

#setup.jump
{
	background: #000;
	transform-origin: center;
	animation: state-jumped-scale-fade 3s ease-in forwards;
}
#setup.jump #globe
{
	animation: state-jumped-rotate 2.5s ease-in forwards;	
}
#setup.jump.hide
{
	display: none;
}
#setup.jump #setup-logo,
#setup.jump #setup-welcome,
#setup.jump .grid
{
	opacity: 0;
	animation: none;
	transition: all 0.5s;
}
