body{
	margin:0px;
	padding:0px;
	position: absolute;
	height:100%;
	width:100%;
	background-size:cover;
	font-style: regular;
	font-family:"Myriad Pro", Myriad,"Helvetica Neue", Helvetica, Arial, sans-serif;
	background-color:#f0f0f1;
}

.webgl-content,#loadingBlock,#errorBrowserBlock{
	padding:0px;
	position:absolute;
	height:100vh;
	width:100vw;
	background-color:#f0f0f1;
}

#gameContainer,canvas{
	position:absolute;
	height:100%;
	width:100%;
	background-color:#f0f0f1;
}

/* Bottom left, not bottom right: the game's right-hand panel puts its hint and
   zoom buttons in the bottom right corner, which the button used to sit on. */
#fullScreenButton{
	height:50px;
	width:50px;
	position:absolute;
	z-index:1;
	bottom:5px;
	left:5px;
	background-color:transparent;
	background-image:url("../img/fullScreen_on.png");
	background-repeat: no-repeat;
	background-position: center;
	background-size:30px 30px;
	border:none;
	cursor: pointer;
}

/* ---- Loading screen -------------------------------------------------------
   The illustrated Hong Kong map fills the page, a translucent white veil sits
   on top of it (the :before below) and the key art + progress bar are centred
   above the veil.                                                     */

#loadingBlock{
	display:flex;
	flex-direction:column;
	align-items:center;
	justify-content:center;
	background-image:url("../img/loading-bg.jpg");
	background-size:cover;
	background-position:center center;
	background-repeat:no-repeat;
	overflow:hidden;
}

#loadingBlock:before{
	content:"";
	position:absolute;
	top:0;
	right:0;
	bottom:0;
	left:0;
	background-color:rgba(255,255,255,0.65);
}

#loadingBlock .logo,
#loadingBlock #progressBar,
#loadingBlock #warningBrowserBlock,
#loadingBlock #warningMobileBlock{
	position:relative;
	z-index:1;
}

.logo{
	height:25vh;
	width:auto;
	display: block;
	margin:auto;
	margin-top:2vh;
}

#loadingBlock .logo{
	height:auto;
	width:auto;
	max-height:56vh;
	max-width:82vw;
	margin:0px;
}

.subtitle{
	color:#1896a7;
	font-size:2.3vh;
	padding-bottom:2.3vh;
	padding-top:2.5vh;
	display: block;
	height:20vh;
	width:40vw;
	margin:auto;
	text-align: center;
}

#emptyBar{
	background: url("../img/progressEmpty.png") no-repeat center;
	background-size:100% 6px;
	float: right;
	width: 60%;
	height: 100%;
	display: inline-block;
}

#fullBar{
	background: url("../img/progressFull.png") no-repeat center;
	background-size:100% 6px;
	float: left;
	width: 40%;
	height: 100%;
	display: inline-block;
}

#progressBar{
	width:min(770px, 60vw);
	margin-top:5vh;
	text-align: center;
	color:#3d5f68;
	font-size:2.4vh;
	letter-spacing:0.28em;
	text-indent:0.28em;
}

.centered{
	height: 6px;
	max-width:770px;
	margin-top:2vh;
	margin-left:auto;
	margin-right:auto;
}

#warningBrowserBlock,#warningMobileBlock,#errorContent{
	height:25vh;
	width:40vw;
	margin:auto;
	text-align: center;
}

#warningBrowserBlock,#warningMobileBlock,#errorContent{
	margin-top:15vh;
	color:#666666;
	font-size:2.3vh;
}

.browserIcons{
	display: inline-flex;
	margin-top:2vh;
}

.browserIcons a{
	width:150px;
}

#errorContent{
	font-size:3vh;
	margin-top:5vh;
}

/* ---- Browser not supported ------------------------------------------------ */

#errorBrowserBlock{
	background-image:url("../img/loading-bg.jpg");
	background-size:cover;
	background-position:center center;
	background-repeat:no-repeat;
	overflow:hidden;
}

#errorBrowserBlock:before{
	content:"";
	position:absolute;
	top:0;
	right:0;
	bottom:0;
	left:0;
	background-color:rgba(255,255,255,0.65);
}

#errorBrowserBlock .logo,
#errorContent{
	position:relative;
	z-index:1;
}


/* When aspect-ratio is smaller than 4/3*/

/*@media (max-aspect-ratio: 4/3){

	.webgl-content{
		-webkit-transform: translate(0%, 0%); transform: translate(0%, 0%);
		-webkit-box-shadow: 0px 0px 29px 0px rgba(0,0,0,0.15);
		-moz-box-shadow: 0px 0px 29px 0px rgba(0,0,0,0.15);
		box-shadow: 0px 0px 29px 0px rgba(0,0,0,0.15);
	}

	.keepRatio{
		width:100%;
		padding-top: 75%;
		position: relative;
		top: 50%;
		transform: translateY(-50%);
	}

	.webgl-content,#loadingBlock,#errorBrowserBlock{
		position: absolute;
		top: 0;
		left: 0;
		bottom: 0;
		right: 0;
		height:100%;
	}

	.logo{
		width:25vw;
		height:auto;
		margin-top:1vh;
	}

	.subtitle{
		font-size:2vw;
		height:10vw;
		padding-bottom:1vw;
		padding-top: 1vw;
	}

	.subtitle,#progressBar,#warningBrowserBlock,#warningMobileBlock,#errorContent{
		width:80vw;
	}

	#progressBar{
		height:6vw;
		margin-top: 2vw;
		font-size:3vw;
	}

	#emptyBar,#fullBar{
		height: 2vw;
	}

	#warningBrowserBlock,#warningMobileBlock,#errorContent{
		margin-top:3vw;
		font-size:2vw;
	}

	.browserIcons{
		margin-top:1vw;
	}

	.browserIcons a{
		width:15vw;
	}

	.browserIcons a img{
		width:8vw;
	}
}*/


/* When aspect-ratio is bigger than 16/9*/

@media (min-aspect-ratio: 16/9){
	body{
		display:flex;
		flex-wrap:wrap;
		justify-content:space-between;
	}

	.keepRatio{
		width:178vh;
		height:100%;
		margin:0 auto;
	}

	.webgl-content,#gameContainer,canvas,#loadingBlock,#errorBrowserBlock{
		width: inherit;
	}

	.webgl-content{
	-webkit-box-shadow: 0px 0px 29px 0px rgba(0,0,0,0.15);
		-moz-box-shadow: 0px 0px 29px 0px rgba(0,0,0,0.15);
		box-shadow: 0px 0px 29px 0px rgba(0,0,0,0.15);
	}

	.subtitle,#warningBrowserBlock,#warningMobileBlock,#errorContent{
		width:100vh;
	}
}


/* ---- Landscape guard -------------------------------------------------------
   The game is laid out for 16:9, so a viewport that is taller than it is wide
   gets a full-screen "turn your device" overlay (#rotateBlock in index.html)
   instead of a scrambled play area. Visibility is decided here in CSS so the
   overlay is already up before the Unity loader has even started; the page
   script only fills in the optional full-screen button.                     */

#rotateBlock{
	display:none;
}

/* Portrait, then landscape, then back — in step with the message. */

@keyframes rotateDevice{
	0%, 18%  { transform:rotate(-90deg); }
	50%, 68% { transform:rotate(0deg); }
	100%     { transform:rotate(-90deg); }
}

@media (orientation: portrait){

	#rotateBlock{
		position:fixed;
		top:0;
		right:0;
		bottom:0;
		left:0;
		z-index:9999;
		display:flex;
		align-items:center;
		justify-content:center;
		box-sizing:border-box;
		padding:6vh 8vw;
		text-align:center;
		/* Keeps a stray swipe from scrolling or pull-to-refreshing the game
		   underneath; taps on the button still work. */
		touch-action:none;
		overflow:hidden;
		/* The loading screen's white veil and its artwork are stacked inside this
		   element's own background rather than as a translucent layer on top of
		   the page, so the overlay paints opaque: the artwork still reads as
		   texture but nothing of the game behind it can show through. The flat
		   colour underneath is the fallback if the artwork is missing. */
		background-color:#f2f7f4;
		background-image:linear-gradient(rgba(255,255,255,0.92), rgba(255,255,255,0.92)),
			url("../img/loading-bg.jpg");
		background-size:cover, cover;
		background-position:center center, center center;
		background-repeat:no-repeat, no-repeat;
	}

	/* .rotateInner is the single flex child that stacks the icon, the two text
	   lines and the button as one centred block. */

	#rotateBlock .rotateIcon{
		display:block;
		width:min(46vw, 180px);
		height:auto;
		margin:0 auto 4vh;
		color:#1896a7;
	}

	#rotateBlock .rotateIconPhone{
		transform-box:view-box;
		transform-origin:80px 80px;
		animation:rotateDevice 2.8s ease-in-out infinite;
	}

	#rotateBlock .rotateTextZh{
		margin:0px;
		color:#3d5f68;
		font-size:clamp(17px, 5vw, 26px);
		line-height:1.5;
		letter-spacing:0.08em;
	}

	#rotateBlock .rotateTextEn{
		margin:1.4vh 0px 0px;
		color:#5c7f88;
		font-size:clamp(13px, 3.4vw, 17px);
		line-height:1.5;
		letter-spacing:0.03em;
	}

	#rotateBlock .rotateButton{
		margin-top:5vh;
		padding:1.6vh 7vw;
		border:2px solid #1896a7;
		border-radius:999px;
		background-color:transparent;
		color:#1896a7;
		font-family:inherit;
		font-size:clamp(13px, 3.4vw, 17px);
		letter-spacing:0.06em;
		cursor:pointer;
	}

	#rotateBlock .rotateButton:active{
		background-color:#1896a7;
		color:#ffffff;
	}
}

@media (orientation: portrait) and (prefers-reduced-motion: reduce){

	#rotateBlock .rotateIconPhone{
		animation:none;
		transform:rotate(-90deg);
	}
}
