
/* - Global - - - - - - */
html {
	height: 100%;
}

@font-face {
  font-family: 'Bahn';
  src: url('bsa.ttf')  format('truetype');
}

#butterfly {
	width: 2.75em;
	margin: 0 0.25em -0.2em 0;
	/*filter: drop-shadow(0 0 0.1em rgba(255,255,255,0.5));*/
}

#home {
	background: url("/resources/img/logo.svg") no-repeat;
	background-size: contain;
	width: 2.75em;
	height: 2.75em;
	text-align: center;
	vertical-align: middle;
	padding-top: 2em;
	box-sizing: border-box;
	letter-spacing: 3px;
	padding-left: 0.3em;
	color: #EEE;
	font-family: 'bahnschrift', 'Bahn', sans-serif;
}

#controls {
	width: 700px;
	position: relative;
}

#controls > div.icon {
	display: block !important;
	width: 1.75em;
	height: 1.75em;
	background-size: contain;
	backgroud-repeat: no-repeat;
	position: absolute;
	filter: drop-shadow(0 0 0.2em rgb(0, 0, 0));
	opacity: 0.9;
	cursor: pointer;
	top: 0.5em;
}

#controls > div#gear {
	right: 0.75em;
	background-image: url('../img/gear.png');
}

#controls > div#squares {
	left: 0.75em;
	background-image: url('../img/squares.png');
	opacity: 0.25;
}

body {
	background: url('../img/noisy_net.png') #21262B;   /* https://www.toptal.com/designers/subtlepatterns/noisy-net/ */
	position: relative;
	min-height: 100%;
	text-shadow: 0 0 1px #000;
	display: flex;
	flex-direction: column;
	text-size-adjust: none;
	-webkit-text-size-adjust: none;
	-moz-text-size-adjust: none;
	text-align: center;
}

html, body {
	margin: 0;
	padding: 0;
	color: #DFDFDF;
	/*font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;*/
	font-family: MS Sans Serif, Geneva, sans-serif;
	overflow-x: hidden;
	touch-action: manipulation;
}

a {
	text-decoration: none;
	color: inherit;
}

#viewport, #selector div, #next, #prev {
	-moz-user-select: none; /* Firefox */
	-ms-user-select: none; /* Internet Explorer */
	-khtml-user-select: none; /* KHTML browsers (e.g. Konqueror) */
	-webkit-user-select: none; /* Chrome, Safari, and Opera */
	-webkit-touch-callout: none; /* Disable Android and iOS callouts*/
}




/* - Header/footer - - - - - - */
h1 { font-size: 20pt; }
h2 { font-size: 15pt; }
h1, h2 {
	width: 800px;
	text-align: left;
	font-weight: normal;
	display: inline-block;
	max-width: 100%;
	margin: 0;
	padding: 0;
	line-height: 115%;
	color: #EEE;
	text-shadow: 0 0 2px #000;
}

#headerCont, #footer {
	background: rgba(0, 0, 0, 0.075);
	border: 1px solid rgba(0,0,0,0.15);
}

#headerCont {
	/*margin: 0 0 6px 0;*/
	margin: 0;
	padding: 0.4ex 1ex 0.6ex;
	border-width: 0 0 1px;
}

#header {
	text-align: left;
	position: relative;
}

#header, #search, #pagination, #selector {
	width: 700px;
	max-width: 100%;
	margin: auto;
}

.home {
	position: absolute;
	top: 50%;
	right: 0;
	transform: translateY(-50%);
	text-align: right;
	line-height: 90%;
	font-style: italic;
	text-shadow: 0 0 1px #1540A0;
	/*background: url('../img/logo.svg') no-repeat;
	padding-left: 24px;*/
}

.home, h2 a { 
	color: #cce6ff;
}

/*#comments {
	display: none;
	background: rgba(0,0,0,0.2);
	padding: 1ex 2ex 0.8ex;
	border-top: 1px solid rgba(0, 0, 0, 0.3);
	margin-top: 1.6ex;
}*/

#footer {
	font-size: 8pt;
	color: #CCC;
	padding: 0.8ex 0;
	border-width: 1px 0 0;
	font-family: Arial, Arial, Helvetica, sans-serif
}




/* - Navigation - - - - - - */
#selectorCont, #controlsCont {
	z-index: 1000;
	position: relative;
}

#selectorCont {
	margin-bottom: 0.25em;
	border-top: 1px solid rgba(0,0,0,0.15);
	background: linear-gradient(to bottom, rgba(0, 0, 0, 0.075), rgba(0, 0, 0, 0))
}

#selectorCont, #controlsCont {
	display: flex;
	justify-content: center;
}



#selector, #controls {
	text-shadow: 0 0 4px #000,0 0 3px #000,0 0 2px #000,0 0 1px #000;
	font-size: 11pt;
}


#searchCont, #selectorCont {
	background: rgba(0,0,0,0.075);
	border: 1px solid rgba(0,0,0,0.15);
	border-width: 1px 0;
	text-shadow: 0 0 4px #000,0 0 3px #000,0 0 2px #000,0 0 1px #000;
}

#searchCont #next, #searchCont #prev {
    position: absolute;
    top: 0;
	display: block;
}

#searchCont div div, #selectorCont div div {
    margin: 0;
	display: inline-block;
	background: rgba(204,230,255,0.05);
	border: 1px solid rgba(0,0,0,0.3);
	border-width: 0 1px;
	padding: 0.8ex 1.4ex 1.2ex;
	box-sizing: border-box;
	cursor: pointer;
}

#selectorCont div div {
	border-right-width: 0;
}

#selectorCont div div:last-child {
	border-right-width: 1px;
}

#searchInput {
	margin: 0;
}

#selectorCont div div, #searchInput {
	line-height: 18px;
}

#selectorCont #selector div {
    background: none;
    width: 25%;
	/*height: 34px !important;*/
	padding: 1ex;
}

#selectorCont #selector div {
    background: rgba(204,230,255,0.05);
    width: 25%;
}

#searchCont #next {
	right: 0;
}

#searchCont div div:not(.dull):hover {
	background: rgba(204,230,255,0.0425);
}

#selector > div, #controls > div div {
	display: inline-block;
	cursor: pointer;
	position: relative;
	margin: 0 0.5ex;
	/*border-radius: 3px;*/
	/*line-height: 120%;*/
}
/*
#selector > div {
	border-radius: 0 0 3px 3px;
}
*/
#controls > div div:not(.active) {
	opacity: 0.5;
	background: none;
	filter: gray;
	filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale");
}

#selector > div {
	background-repeat: no-repeat;
	background-size: auto 100%;
}

#select_gacha { background-image: url('../img/select.png'); }
#selector #select_threejs, #selector #select_concept { background-image: url('../img/select.jpg'); }

#select_threejs { background-position-x:   0% }
#select_gacha   { background-position-x:   0% }
#select_concept { background-position-x: 100% }

#selector > div {
	/*width: 2em;*/
	background-repeat: no-repeat;
	background-size: auto 100%;
	background-position: center center;
	padding: 8px !important;
}

#selector .play { background-image: url('../img/play.png'); }
#selector .info { background-image: url('../img/info.png'); }

#selector > div > div {
	position: absolute;
	top: 50%;
	right: 0;
	transform: translateY(-50%);
}

#selector > div a {
	width: 100%;
	height: 100%;
	display: block;
}

#selector img {
	/*background: rgba(255, 255, 255, 0.3);
	border: 1px solid black;*/
	/*border-radius: 0.5ex;*/
	max-width: 100px;
	width: 100%;
}




/* - Controls - - - - - - - - */
#controls *::selection {
	color: none;
	background: none;
}

#controls *::-moz-selection {
	color: none;
	background: none;
}

#controls > div div {
	background: rgba(204, 230, 255, 0.25);
	padding: 0.25ex 1ex;
	border: 1px solid rgba(0,0,0,0.3);
}

#controls > div {
	display: none;
}

#controls.active > div.active {
	display: initial;
	position: absolute;
	left: 20%;
	right: 20%;
}

#controls .group div {
	margin: 0;
	border-radius: 0;
	border-right-width: 0;
}

#controls .group div:first-child {
	border-top-left-radius: 3px;
	border-bottom-left-radius: 3px;
	margin-left: 0.5ex;
}

#controls .group div:last-child {
	border-top-right-radius: 3px;
	border-bottom-right-radius: 3px;
	margin-right: 0.5ex;
	border-right-width: 1px;
}


/* - List - - - - - - */
#list {
	font-size: 0;
	padding: 12px 0;
	margin: auto;
	touch-action: none;
}

#list > a {
	display: inline-block;
	
	height: 7.5vw;
	width: 7.5vw;
	
	min-width: 0.675in;
	min-height: 0.675in;
	
	max-width: 128px;
	max-height: 128px;
	
	margin: 0.75%;
	background-size: 100%;
	filter: drop-shadow(0 0 2px rgba(0,0,0,0.5));
	background-repeat: no-repeat;
	
	font-size: 11pt;
	text-shadow: 0 0 2px #000, 0 0 2px #000, 0 0 2px #000, 0 0 2px #000, 0 0 2px #000, 0 0 2px #000;
	line-height: 17pt;
}

.missing {
	opacity: 0.2;
	filter: blur(1.5px);
}

.noModel {
	opacity: 0.5;
	filter: grayscale(75%);
}

#search {
	position: relative;
	overflow: hidden;
}

#searchInput {
	width: 100%;
	color: #000;
	font-size: 11pt;
	background: none;
	border: none;
	border-radius: 0;
	
	color: #FFF;
	padding: 1ex;
	text-align: center;
}

#search .dull {
	cursor: default;
	color: rgba(255,255,255,0.3);
	background: rgba(204,230,255,0.01);
	text-shadow: none;
}

#selectorCont #selector > div:not(.active) {
	background: rgba(204,230,255,0.01);
	color: rgba(255,255,255,0.7);
}

#pagination {
	font-size: 0;
}

#pagination.flex {
	display: flex;
	flex-direction: row;
}

#pagination div {
	width: 6px;
	height: 6px;
	background: rgba(255,255,255,0.175);
	display: inline-block;
	margin: 0 10px;
	border-radius: 1px;
	position: relative;
	transition: background 0.2s;
}

#pagination.flex div {
	margin: auto;
}

#headerCont, #searchCont, #footer, #pagination div, #selectorCont {
    box-shadow: 0 0 3px rgba(0,0,0,0.2);
}

#pagination .active {
	background: rgba(255,255,255,0.7);
}



/* - Content area - - - - - - */
#message {
	margin: auto;
}

#indexCont {
	padding: 0 1ex 1.5ex;
}

#index img {
	width: 4em;
}

#index h3 {
	font-weight: normal;
	margin: 1em 0 0;
	padding: 0;
}

.unavailable {
	opacity: 0.5;
}

.spacer {
	display: inline-block;
	width: 1em;
}

canvas {
	width: 100%;
	/*max-width: 800px;*/
	height: initial !important;
	/*background: rgba(0,0,0,0.1);*/
	touch-action: none;
}

#viewport {
	position: relative;
	margin: auto;
	width: 100%;
}

#viewport > * {
	display: none !important;
}

twitter-widget {
	margin: auto !important;
}

#threejs * {
	display: initial;
}

#viewport #loader {
	display: block;
	top: 0;
}

#viewport #loader img {
	display: inherit;
}

#viewport .active {
   /* visibility: visible !important;*/
   display: inline-block !important;
}

#viewport .imageCont {
	/*height: 100%;*/
	overflow: hidden;
	display: inline-block;
}

#viewport img {
	margin: auto;
	max-width: 100%;
	display: block;
	position: relative;
}

#viewport img, #gacha {
	/*border: 1px solid #22272C;*/
	border-radius: 20px;
}

#gacha.GachaBg {
	background: no-repeat bottom;
	background-size: cover;
}

#gacha:not(.GachaBg) {
	background: none !important;
}




/* - Facemap - - - - - - */
#control_threejs.ChooseFace #facemap {
	display: block;
}

#facemap {
	display: none;
	width: 100%;
	position: relative;
	transform: translateX( calc((100% - 200px)/8) );
	top: 2.5em;
	z-index: 100;
}

#facemap img {
	position: absolute;
	z-index: 100;
	top: 50px;
	width: 100px;
	margin-top: -50px;
}