/* CSS HEX */
--light-goldenrod-yellow: #F3F4CE;
--shadow: #7F7B65;
--lapis-lazuli: #105A8C;
--ocean-blue: #5434AE;
--light-cyan: #CCE0DE;
--dark-blue: #022A4C;
/* CSS HEX */
--flax: #EAD97D;
--radical-red: #FF3366;
--cyber-grape: #4D3B77;
--medium-aquamarine: #7FE2A7;
/**/
/*--Fonts set to Open Sans and Lato and default to a sans-serif--*/
@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,400;0,700;1,400;1,700&family=Open+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap');


/*
	Patrick Hand for a handwriting-style font.
*/
@import url('https://fonts.googleapis.com/css2?family=Patrick+Hand&display=swap');


/*
	-------------------------------------------------------		STRUCTURAL
*/

* {
	box-sizing: border-box;
}


body {
	/*background-color: #222;*/
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: 'Open Sans', sans-serif;
	font-size: 14pt;
    color:#022A4C;
}

sup {
	font-size: 60%;
}
/*	Some hacks to make subscripted chemical notations not bump down
	the line height. */
sub {
	font-size: 70%;
	vertical-align: baseline;
	position: relative;
	bottom: -4px;
}

.wiggly > span > span {
	animation-name: wiggle;
	animation-duration: 1s;
	animation-iteration-count: infinite;
	display: inline-block;
	position: relative;
}
@keyframes wiggle {
	0% { transform: rotate( 0deg ) scale(1.04) translate( 0px, -0.5px );}
	32.99% { transform: rotate( 0deg ) scale(1.04) translate( 0px, -0.5px ); }
	33% { transform: rotate( 5deg ) scale( 0.96 ); }
	65.99% { transform: rotate( 5deg ) scale( 0.96 ); }
	66% { transform: rotate( -5deg ) scale( 1.0 ) translate( 0px, 0.5px ); }
	100% { transform: rotate( -5deg ) scale( 1.0 ) translate( 0px, 0.5px ); }
}
.wiggly > span > span:nth-child(3n+1) {
	animation-delay: -0.3s;
}
.wiggly > span > span:nth-child(3n+2) {
	animation-delay: -0.6s;
}

 #LAB-CONTAINER {
	width: 960px;
	height: 600px;
	position: relative;
}

/*
	-------------------------------------------------------		UTILITY
*/

.arrive {
	animation-name: circular-appear;
	animation-fill-mode: forwards;
	animation-duration: 2s;
	animation-iteration-count: once;
}
@keyframes circular-appear {
	from { clip-path: circle( 0% ); }
	to { clip-path: circle( 100% ); }
}

.write-in {
	animation-name: write-in-appear;
	animation-fill-mode: forwards;
	animation-duration: 2s;
	animation-iteration-count: once;
	color: #9b5400;
}
@keyframes write-in-appear {
	from { clip-path: inset(0% 100% 0% 0%); }
	to { clip-path: inset(0% 0% 0% 0%); }
}

.click-prompt {
	cursor:pointer;
	animationz: click-prompt-animation 1s steps(1,start) infinite;
	animation-name: click-prompt-animation;
	animation-duration: 1s;
	animation-iteration-count: infinite;
}
@keyframes click-prompt-animation {
	0% {
		filter:
			drop-shadow(4px 0 0 orange)
			drop-shadow(0 4px 0 orange)
			drop-shadow(-4px 0 0 orange)
			drop-shadow(0 -4px 0 orange)
			drop-shadow(2px 0 0 black)
			drop-shadow(0 2px 0 black)
			drop-shadow(-2px 0 0 black)
			drop-shadow(0 -2px 0 black);
		}
	50% {
		filter:
			drop-shadow(4px 0 0 orange)
			drop-shadow(0 4px 0 orange)
			drop-shadow(-4px 0 0 orange)
			drop-shadow(0 -4px 0 orange)
			drop-shadow(2px 0 0 black)
			drop-shadow(0 2px 0 black)
			drop-shadow(-2px 0 0 black)
			drop-shadow(0 -2px 0 black);
		}
	51% { filter: none;
		}
	100% { filter: none;
		}
}

.slide-in-from-right {
	animation-name: slide-from-right;
	animation-duration: 0.5s;
	animation-timing-function: ease-out;
}

@keyframes slide-from-right {
	from { opacity: 0; transform: translate(100px,0px); }
	to { opacity: 1, transform: translate(0px,0px); }
}

.slide-in-from-left {
	animation-name: slide-from-left;
	animation-duration: 0.5s;
	animation-timing-function: ease-out;
}

@keyframes slide-from-left {
	from { opacity: 0; transform: translate(-100px,0px); }
	to { opacity: 1, transform: translate(0px,0px); }
}


.click-target {
	--border-color: #000;
	position: absolute;
	border: 8px dashed orange;
	border-radius: 50px;

	animation-name: click-target-animation;
	animation-duration: 1s;
	animation-iteration-count: infinite;
	display: inline-block;
	position: relative;
}
@keyframes click-target-animation {
	0% {
		border: 8px dashed var(--border-color);
	}
	49.99% {
		border: 8px dashed var(--border-color);
	}
	50% {
		border: 7.5px dashed var(--border-color);
	}
	100% {
		border: 7.5px dashed var(--border-color);
	}
}



/*
	-------------------------------------------------------		MENU
*/
#MENU {
	position: absolute;
	left: 0px;
	top: 0px;
	background-image: url( images/ui/sidebar-bg.png );
	width: 239px;
	height: 600px;
	overflow: hidden;
}

#MENU-PROGRESS {
	position: absolute;
	left: 19px;
	top: -16px;
	background-image: url( images/ui/sidebar-progress-1.png );
	width: 39px;
	height: 580px;
}

#MENU-PROGRESS.chapter-2 { background-image: url( images/ui/sidebar-progress-2.png ); }
#MENU-PROGRESS.chapter-3 { background-image: url( images/ui/sidebar-progress-3.png ); }
#MENU-PROGRESS.chapter-4 { background-image: url( images/ui/sidebar-progress-4.png ); }
#MENU-PROGRESS.chapter-5 { background-image: url( images/ui/sidebar-progress-5.png ); }
#MENU-PROGRESS.chapter-6 { background-image: url( images/ui/sidebar-progress-6.png ); }
#MENU-PROGRESS.chapter-7 { background-image: url( images/ui/sidebar-progress-7.png ); }
#MENU-PROGRESS.chapter-8 { background-image: url( images/ui/sidebar-progress-8.png ); }
#MENU-PROGRESS.chapter-9 { background-image: url( images/ui/sidebar-progress-9.png ); }

.menu-item {
	font-family: 'Patrick Hand', cursive;
}

#CHAPTER-BUTTONS > * { position: relative; }
#CHAPTER-BUTTONS > :nth-child( 2 ) { top: -11px; }
#CHAPTER-BUTTONS > :nth-child( 3 ) { top: -22px; }
#CHAPTER-BUTTONS > :nth-child( 4 ) { top: -33px; }
#CHAPTER-BUTTONS > :nth-child( 5 ) { top: -44px; }
#CHAPTER-BUTTONS > :nth-child( 6 ) { top: -55px; }
#CHAPTER-BUTTONS > :nth-child( 7 ) { top: -66px; }
#CHAPTER-BUTTONS > :nth-child( 8 ) { top: -77px; }
#CHAPTER-BUTTONS > :nth-child( 9 ) { top: -88px; }

.chapter-button {
	background-image: url( images/ui/sidebar-button-up.png );
}
.chapter-button:hover {
	background-image: url( images/ui/sidebar-button-hover.png );
}
.chapter-button:hover .menu-item-text {
	transform: scale( 1.1 );
}
.chapter-button:active {
	background-image: url( images/ui/sidebar-button-down.png );
}
.chapter-button:active .menu-item-text {
	transform: scale( 0.8 );
}

.chapter-button {
	display: grid;
	align-items: center;
	justify-items: left;
	width: 210px;
	height: 75px;
}
.menu-item-text {
	position: absolute;
	font-family: 'Patrick Hand', cursive;
	left: 70px;
	top: 6px;
	width: 120px;
	font-size: 18pt;
	line-height: 0.9;
	height: 50px;
	display: grid;
	align-items: center;
	justify-items: left;
	pointer-events: none;
}
#CREDITS-BUTTON {
	position: absolute;
	bottom: -3px;
	left: 0px;
	font-family: 'Patrick Hand', cursive;
	background-image: url( images/ui/credits-up.png );
	width: 76px;
	height: 35px;
	text-align: center;
	display: grid;
	align-items: center;
	justify-items: center;
}
#CREDITS-BUTTON:hover {
	background-image: url( images/ui/credits-hover.png );
}
#CREDITS-BUTTON:hover > div {
	transform: scale( 1.1 );
}
#CREDITS-BUTTON:active {
	background-image: url( images/ui/credits-down.png );
}
#CREDITS-BUTTON:active > div {
	transform: scale( 0.9 );
}

button#next-button {
	background-image: url( images/ui/next-up.png );
	width: 187px;
	height: 72px;
	background-color: transparent;
	pointer-events: all;
}
button#next-button:hover {
	background-image: url( images/ui/next-hover.png );
}
button#next-button:active {
	background-image: url( images/ui/next-down.png );
}

#previous-button {
	position: absolute;
	background-image: url( images/ui/back-up.png );
	width: 47px;
	height: 60px;
	background-color: transparent;
	pointer-events: all;
	bottom: 10px;
	left: 20px;
	z-index: 100;
}
#previous-button:hover {
	background-image: url( images/ui/back-over.png );
}
#previous-button:active {
	background-image: url( images/ui/back-down.png );
}

/*
	-------------------------------------------------------		LAB
*/

.background {
	width: 725px;
	height: 600px;
	position: absolute;
	left: 0px;
	top:0px;
}
#LAB > img, #LAB > .flipbook {
	position: absolute;
}

.balloon {
	position: relative;
	left: 30px;
	top: 30px;
	width: 560px;
	padding: 0px;
	padding-top: -100px;
	border: 32px double orange;
	border-image: url(images/ui/balloon-no-attributor.png) 20 32 32 32 stretch;
	border-image-slice: 20 32 32 32 fill;
	font-family: 'Patrick Hand', cursive;
	font-size: 24px;
}

.balloon.rdown:after {
	content: " ";
	background-image: url(images/ui/balloon-down-right-attributor.png);
	width: 57px;
	height:61px;
	position: absolute;
	right: -67px;
	top: 0px;
}

.balloon,
.balloon-like {
	color: #022A4C;
    max-width:590px !important; /*    noticed a few at 700px were getting clipped */
}

.balloon h1 {
	font-size: 28px;
	font-weight: bold;
	border-bottom: 3px dotted black;
}

.balloon .dialogue p,
.balloon-like .dialogue p {
    line-height:28px;
    margin-top:0;
        margin-bottom:10px;
}
.balloon .dialogue p:last-child,
.balloon-like .dialogue p:last-child,
.balloon p:last-child
 {
        margin-bottom:10px;
}
.balloon > :first-child,
.infobox > :first-child,
.balloon-like > :first-child {
	margin-top: 0px;
}

.increment-balloon {
	left: 20px;
	top: 370px;
	width: 123px;
	height: 65px;
	padding-top: 12px;
	background-image: url( images/ui/balloon-small.png );
	text-align: center;
	font-family: 'Patrick Hand', cursive;
	font-size: 24px;
	box-sizing: border-box;
	animation-name: balloon-animate-in;
	animation-duration: 0.5s;
	animation-timing-function: cubic-bezier(0,.68,.03,1.18);
	transform-origin: 0% 95%;
	transform-origin: 50% 50%;
}

.tts-button {
	position: absolute;
	right: 5px;
	top: 5px;
	width: 20px;
	height: 20px;
	border: 2px solid black;
	border-radius: 5px;
	padding: 5px;
	background-color: white;
	fill: black;
	stroke: black;
	stroke-width: 1;
}

.tts-button:hover {
	transform: scale( 1.1 );
}

.tts-button:active {
	background-color: black;
	fill: white;
	stroke: white;
}

/*	Class for providing text-to-speech content when no balloon is available. */
.speakable {
	display: none;
}

.info-button {
	background-image: url( images/ui/info-up.png );
	width: 47px;
	height: 60px;
	position: absolute;
	right: -20px;
	bottom: -55px;
}
.info-button:hover {
	background-image: url( images/ui/info-over.png );
}
.info-button:active {
	background-image: url( images/ui/info-down.png );
}



#LAB {
	position: absolute;
	top: 0px;
	right: 0px;
	width: 725px;
	height: 600px;
	box-shadow: 10px 10px 10px black;
	overflow: hidden;
	background-image: url( images/ui/paper-background.png );
  -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
     -khtml-user-select: none; /* Konqueror HTML */
       -moz-user-select: none; /* Old versions of Firefox */
        -ms-user-select: none; /* Internet Explorer/Edge */
            user-select: none; /* Non-prefixed version, currently
                                  supported by Chrome, Edge, Opera and Firefox */
}

.lab-state {
	position: absolute;
	left: 0px;
	top: 0px;
	width: 725px;
	height: 600px;
	transition: filter .25s;
	isolation: isolate;			/*	So that layers are always independent. */
}

.lab-state > * {
	position: relative;
}

.lab-state > * {
	position: absolute;
}

.flipbook {
	position: absolute;
}
.flipbook img {
	position: absolute;
	left: 0px;
	top: 0px;
}

#invisble-thumb {
	position: absolute;
	left: 0px;
	top: 0px;
}

/*
	-------------------------------------------------------		PAUSE MENU
*/
.pause-menu {

	left: 40px;
	top: 40px;
	max-width: 500px;
	border: 2px solid #021A3C;
	background-color: #022A4C;
	color: white;
	padding: 46px;
	border-radius: 1em;
	position: relative;
	text-align: center;
	display: grid;
    animation: menu_animation .4s cubic-bezier(0,.68,.03,1.18);
    transform-origin: 0 0;
}
@keyframes menu_animation {
    0%{
        transform:translate(-30px, -30px) scale(.8);
    }
    100%{
         transform:translate3d(0, 0, 0) scale(1);
    }

}
.pause-menu button[onclick*=goToChapter] {
    background-image:none;
    background-color:#105A8C;
    border-color:#022A4C;
}

.pause-menu button[onclick*=goToChapter]:hover,
.pause-menu button[onclick*=goToChapter]:focus
{
    background-image:none;
    background-color:#004A7C !important;
    border-color:#CCE0DE;
}
.pause-menu button[onclick*=goToChapter]:active {
    background-image:none;
    background-color:#002A5C !important;
    border-color:#CCE0DE;
    transform: translateY(1px) !important;
}
.pause-menu-button-label {
	text-align: left;
}

.button-bar {
	position: absolute;
	right: 5px;
	bottom: 5px;
	text-align: right;
}

.balloon .button-bar,
.infobox .button-bar,
.balloon-like .button-bar {
	bottom: -20px;
}

.infobox {
	max-width: 575px;
	border: 2px solid #022A4C;
	background-color: #105A8C;
	color: white;
	padding: 20px 40px;
	border-radius: 1em;
	position: relative;
    display:flex;
    align-items: left;
    flex-flow: column;
    justify-content: flex-start;
}
.infobox h2 {
    margin:0 0 4px;
    font-family: 'Lato', sans-serif;
    font-size:20pt;
    letter-spacing: .04em;
    padding-bottom:4px;
}
.infobox p {
    margin:auto 0 10px;
    line-height:1.6;
}
.infobox p[style] {
    border-radius:10px;
    overflow: hidden;
    border:2px solid rgba(255,255,255, .8);
}
.infobox ul, .infobox ol {
    margin:5px 0;
}
.infobox li {
	margin:auto 0 8px;
}
.infobox img {
}
.with-portrait {
    padding-left:84px;
    width:480px !important;
}
.with-portrait:after {

	width: 150px;
	height: 150px;
	background-image: url("images/balloon-portrait.png");
    background-repeat: no-repeat;
    background-size:106%;
    background-position:-5px -5px;
	content: ' ';
    border-radius:100%;
    overflow: hidden;
    border:2px solid #022A4C;
	position: absolute;
	left: -80px;
	top: calc( 50% - 76px);
	display: block;
	pointer-events: none;
}

@keyframes balloon-animate-in {
	0% {
		transform:scale(0);
		opacity: 0;
	}
/*
	70% {
		transform:scale(1.1);
		opacity: 1.0;
	}
*/
	100% {
		transform:scale(1);
		opacity: 1;
	}
 }

.balloon,
.balloon-like {
	animation-name: balloon-animate-in;
	animation-duration: 0.5s;
	animation-timing-function: cubic-bezier(0,.68,.03,1.18);
	transform-origin: 0% 95%;
	transform-origin: 50% 50%;
 }

 .balloon.holdover,
 .balloon-like.holdover,
 .increment-balloon.holdover {
 	animation-name: none;
 }

.lab-state button {
	font-size: 14pt;
	cursor: pointer;
    font-family:'Open Sans', sans-serif;
	font-family: 'Patrick Hand', cursive;
	font-size: 30px;
    font-weight:600;
    letter-spacing: .03em;
    border: none;
    padding-bottom: 12px;
    color: white;
}

.lab-state button b,
li b {
/*	font-weight: normal;*/
	text-decoration: underline;
}

.lab-state button:hover,  .lab-state button:focus {
	border-color:rgba(154, 92, 254, 1);
	font-size: 34px;
}

.lab-state button:active {
	border-color:rgba(154, 92, 254, 1);
	font-size: 26px;
}

.lab-state button[disabled] {
	background-color: #666;
	color:rgba(255,255,255,.2);
	z-opacity: 0.5;
	pointer-events: none;
}
.lab-state button[onclick*=narrate] {
    top:0 !important;
}
.lab-state button[onclick*=narrate] img {
    height:28px;
    width:28px;
    padding:0;
    margin-top:-2px;
}


@keyframes infobox-animate-in {
	0% {
		transform:scale(0.5);
		opacity: 0;
	}
/*
	70% {
		transform:scale(1.1);
		opacity: 1.0;
	}
*/
	100% {
		transform:scale(1);
		opacity: 1;
	}
 }

.infobox {
	animation-name: infobox-animate-in;
	animation-duration: 0.35s;
	animation-timing-function: cubic-bezier(0,.68,.03,1.18);
 }

@keyframes fade-in-animation {
	0% {
		opacity: 0;
	}
	100% {
		opacity: 1;
	}
 }

.fade-in {
	animation-name: fade-in-animation;
	animation-duration: 1.0s;
	animation-timing-function: ease;
 }

/*
	Handy animations
	Example:
	animation: floatRotation 10s ease-in-out infinite;
	animation: floatUpDown 10s ease-in-out infinite;
	animation: shakeUpDown 2s ease-in-out once;
	animation: strobeOpacity 1s ease-in-out infinite;
	animation: shimmy 0.5s step-end infinite;
*/

@keyframes floatRotation {
	0% { transform: rotate(-10deg); }
	50% { transform: rotate(10deg); }
	100% { transform: rotate(-10deg); }
}
@keyframes floatUpDown {
	0% { transform: translatey(10px); }
	50% { transform: translatey(-10px); }
	100% { transform: translatey(10px); }
}
@keyframes blinkAnimation {
	0% { opacity: 1.0; }
	49% { opacity: 1.0; }
	50% { opacity: 0.0; }
	99% { opacity: 0.0; }
	100% { opacity: 1.0; }
}
@keyframes strobeOpacity {
	0% { opacity: 0; }
	50% { opacity: 1; }
	100% { opacity: 0; transform: rotation( 90deg ); }
}
.lab-state button[onclick*="didHome()"] {
    padding:2px;
    height:80px;
    width:80px;
    display:flex;
    justify-content: center;
    flex-flow: column;
    align-items: center;
}
.hamburger-menu {
	font-size: 18pt;
    margin:0px auto 5px;
    padding:0;
    line-height:18pt;
}

.current-chapter {
	font-size: 8pt;
    text-transform:uppercase;
    display:flex;
    justify-content: center;
    align-items: center;
    flex-flow: column;
    }

.chapter-number {
	font-weight: bold;
	font-size: 20pt;
    display:block;
    margin:0;
    line-height:17pt;
    padding:0;
}

/*	Handy CSS rules during development	*/
#current-state {
	color: #999;
	margin-top: 1em;
	font-family: monospace;
	font-size: 75%;
	overflow: hidden;
}

.notification {
	position: absolute;
	margin: 0px 50px;
	z-width: 700px;
	bottom: -100px;
	opacity: 0;
	padding: 1em;
	border: 2px solid #369;
	border-radius: 1em 1em 0em 0em;
	background-color: rgba(0,0,0,0.9);
	color: white;
	transition: all 0.5s ease;
	font-family: 'Patrick Hand', cursive;
	font-size: 18pt;
}

.notification h2 {
	text-align: center;
	border-bottom: 1px solid white;
	margin-top: 0px;
	padding-top: 0px;
	font-size: 100%;
}

.notification u {
	font-weight: bold;
	display: inline-block;
	border: 1px solid green;
	background-color: #030;
	color: white;
	padding: 3px 7px;
	border-radius: 3px;
	min-width: 10px;
	text-align: center;
}


#MUTE-BUTTON {
	background-color: #4D3B77;
	border-radius: 0px 0px 0px 10px;
	position: absolute;
	right: 0px;
	top: 0px;
	width: 40px;
	height: 40px;
	background-image: url( "images/volume_on.png" );
	background-repeat: no-repeat;
	background-position: center center;
	z-index: 1000;
}

#MUTE-BUTTON.muted {
	background-image: url( "images/volume_mute.png" );
}
