/* XWUZ base styles
   The games are a fixed 320x356 design. js/xwuz.js scales #container to fit
   the screen, so everything inside it stays in "2008 pixels".
   The homepage (html.home) is an ordinary responsive page. */

html, body {
	margin: 0;
	padding: 0;
	border: 0;
}

html {
	background-color: #1b222c;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	color: #a3b3c3;
	font-size: 11px;
	line-height: normal;
}

a {
	color: #ffffff;
}

img {
	border: 0;
}

.fontostext {
	color: #ffffff;
}


/* GAME PAGES [ */
html.game, html.game body {
	height: 100%;
	overflow: hidden;
	overscroll-behavior: none;
}

html.game body {
	position: fixed;
	left: 0;
	top: 0;
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: radial-gradient(ellipse 120% 80% at 50% 40%, #323d4b 0%, #1b222c 70%, #141a22 100%);
}

/* no double-tap zoom, no pinch zoom, no text selection loupe, no tap flash */
html.game, html.game body, html.game body * {
	touch-action: none;
	-webkit-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
	-webkit-tap-highlight-color: transparent;
}

/* title row above the game: only when the screen has room (body.roomy).
   Nothing tappable goes below the game: that's where thumbs are while playing. */
#pagehead {
	display: none;
	flex: none;
	box-sizing: border-box;
	width: var(--framew, 320px);
	max-width: 100%;
}

.roomy #pagehead {
	display: flex;
	align-items: center;
	gap: calc(12px * var(--u, 1));
	height: calc(68px * var(--u, 1));
	padding: 0 calc(14px * var(--u, 1)) calc(6px * var(--u, 1)) calc(14px * var(--u, 1));
}

/* keeps the game optically centred under the title row */
.roomy #frame {
	margin-bottom: calc(68px * var(--u, 1));
}

#pagehead img {
	width: calc(44px * var(--u, 1));
	height: calc(44px * var(--u, 1));
	flex: none;
}

#pagehead div {
	flex: 1;
	min-width: 0;
}

#pagehead h1 {
	margin: 0;
	font-size: calc(21px * var(--u, 1));
	line-height: 1.15;
	color: #ffffff;
}

#pagehead p {
	margin: 1px 0 0 0;
	font-size: calc(13px * var(--u, 1));
	color: #a3b3c3;
}

#moregames {
	flex: none;
	padding: calc(7px * var(--u, 1)) calc(12px * var(--u, 1));
	border-radius: 99px;
	background-color: rgba(255, 255, 255, .08);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
	font-size: calc(13px * var(--u, 1));
	font-weight: bold;
	color: #c0c9d5;
	text-decoration: none;
	white-space: nowrap;
}

#frame {
	position: relative;
	flex: none;
	overflow: hidden;
	width: 320px;
	height: 356px;
	background-color: #000000;
	visibility: hidden; /* shown by js/xwuz.js once it's scaled */
}

#frame.card {
	border-radius: var(--frameradius, 10px);
	box-shadow: 0 6px 30px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .4);
}

#container {
	position: absolute;
	left: 0;
	top: 0;
	width: 320px;
	height: 356px;
	overflow: hidden;
	transform-origin: 0 0;
}

#container h1 {
	margin: 0;
	margin-left: .5em;
}

#container h3 {
	font-size: 13px;
	margin: 12px;
	padding-left: 0;
	margin-bottom: .5em;
	color: #ffffff;
}

#container p {
	margin: .5em 12px;
}

#container td {
	text-align: center;
	font-size: 10px;
}

.ibox {
	width: 320px;
	height: 315px;
	overflow: hidden;
	background-color: #000000;
	margin: auto;
}

.iboxcontent {
	width: 320px;
	height: 315px;
	float: left;
	overflow: hidden;
}

.ibc1 {
	background-color: #3b4859;
	background-image: url(../i/bg1.png);
}

.ibc2 {
	background-color: #404d5e;
	background-image: url(../i/bg2.png);
}

#stage_contents {
	width: 10000px;
	transition: transform .25s ease-out;
}

/* the dialog */
#alertbox {
	display: none;
	position: absolute;
	z-index: 200;
}

#alertbox_flekk {
	position: absolute;
	width: 320px;
	height: 356px;
	background-color: #000000;
	opacity: .8;
}

#alertbox_content {
	position: absolute;
	width: 320px;
	height: 256px;
	margin-top: 70px;
	text-align: center;
	color: #ffffff;
}

#alertbox_content .fontostext {
	color: #a3b3c3;
}

.xbtn {
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	width: 110px;
	height: 50px;
	margin: 2px 12px;
	padding: 0 0 1px 0;
	border: 1px solid rgba(255, 255, 255, .55);
	border-radius: 9px;
	background: linear-gradient(#a8b5c3, #7c8fa9);
	box-shadow: 0 1px 3px rgba(0, 0, 0, .55);
	color: #ffffff;
	font: bold 25px/1 "Helvetica Neue", Helvetica, Arial, sans-serif;
	text-shadow: 0 1px 1px rgba(52, 66, 86, .75);
	cursor: pointer;
}

.xbtn:active {
	background: linear-gradient(#97a5b5, #6c7f99);
}

.xbtn:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: 2px;
}

/* the menu bar */
#imenu {
	display: flex;
	width: 320px;
	height: 41px;
	margin: auto;
	background: linear-gradient(#a8b5c3 0, #a8b5c3 24%, #7d8fa9 73%, #7d8fa9 100%);
	box-shadow: inset 0 -1px 0 #5b6a81;
}

#imenu a {
	display: block;
	height: 41px;
	font-size: 15px;
	font-weight: bold;
	line-height: 42px;
	text-align: center;
	text-decoration: none;
	color: #c0c9d5;
	text-shadow: 0 1px 1px rgba(75, 90, 112, .7);
}

#imenu a.active {
	color: #f7f8fa;
}

#button_game      { width: 72px; }
#button_highscore { width: 110px; }
#button_about     { width: 70px; }

@media (hover: hover) {
	#imenu a:hover {
		opacity: .6;
	}
}

#button_xwuz {
	position: absolute;
	display: block;
	width: 45px;
	height: 57px;
	margin: 5px 0 0 267px;
	background-image: url(../i/xwuz@4x.png);
	background-size: 48px 57px;
	background-repeat: no-repeat;
	z-index: 1;
	cursor: pointer;
}

#score.highscore {
	color: #ff4444;
}

#yourbest {
	text-align: center;
	font-weight: bold;
	color: #ffffff;
	font-size: 45px;
	margin: .5em auto .5em auto;
	background-image: url(../i/flekk.png);
	width: 296px;
	height: 65px;
	padding-top: 15px;
}

#table_about {
	margin-top: 10px;
}

#table_about img {
	vertical-align: middle;
}

#scoretable {
	width: 237px;
	margin-left: 13px;
	margin-top: 10px;
	font-size: 12px;
	height: 17px;
	overflow: hidden;
}

#scoretable div {
	float: left;
}

#score, #combo, #level {
	color: #ffffff;
}

#score {
	width: 2em;
}

#level {
	width: 1em;
}

#combo {
	width: 1.5em;
}

#levelp {
	margin-left: 1.5em;
}

#combop {
	float: right !important;
}
/* ] GAME PAGES */


/* BUBBLE TROUBLE [ */
#bt_realarea {
	clear: both;
	padding: 0;
	margin-left: 11px;
	margin-top: 12px;
	width: 297px;
	height: 264px;
	background-image: url(../bubble/i/bgch.png);
	position: relative;
}

.bubble {
	position: absolute;
	background-image: url(../bubble/i/b.svg?v=13);
	background-size: 33px 198px;
	display: block;
	width: 33px;
	height: 33px;
	opacity: 0;
}
/* the tap layer over the bubbles and its off-screen switch (see touchlayer in bubble/js/game.js) */
#bt_touch {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	z-index: 2;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
#bt_tick {
	position: fixed;
	left: -999px;
	top: 0;
	opacity: 0;
}
/* ] BUBBLE TROUBLE */


/* STACK THE LOG [ */
#ibox_game.stack {
	position: relative;
}

#st_scoretable {
	position: absolute;
	z-index: 20;
	width: 237px;
	height: 17px;
	overflow: hidden;
	margin-left: 13px;
	padding-top: 10px;
	font-size: 12px;
}

#st_scoretable .l, #st_scoretable .l div {
	float: left;
}

#st_scoretable .r {
	float: right;
}

#st_scoretable .r div {
	float: left;
}

#st_scoretable .c {
	text-align: center;
}

#st_outerarea {
	width: 320px;
	height: 316px;
	overflow: hidden;
	position: relative;
}

/* the big green button: the whole strip is the tap target, the span is what you see */
.st_button {
	position: absolute;
	z-index: 30;
	width: 320px;
	height: 72px;
	margin: 243px 0 0 0;
	cursor: pointer;
}

.st_button span {
	position: absolute;
	left: 19px;
	top: 15px;
	box-sizing: border-box;
	width: 282px;
	height: 42px;
	border: 1px solid rgba(108, 150, 42, .85);
	border-radius: 9px;
	background: linear-gradient(rgba(185, 237, 73, .85) 0%, rgba(160, 212, 67, .85) 47%, rgba(141, 197, 63, .85) 51%, rgba(97, 138, 47, .85) 100%);
	box-shadow: 0 0 9px 2px rgba(177, 246, 74, .5);
	color: #ffffff;
	font-size: 19px;
	font-weight: bold;
	line-height: 39px;
	text-align: center;
	text-shadow: 0 1px 1px rgba(52, 82, 16, .7);
}

.st_button:active span {
	background: linear-gradient(rgba(166, 218, 62, .9) 0%, rgba(141, 193, 56, .9) 47%, rgba(122, 178, 52, .9) 51%, rgba(84, 122, 40, .9) 100%);
}
/* ] STACK THE LOG */


/* HOMEPAGE [ */
html.home {
	background-color: #3b4859;
	background-image: url(../i/bg1.png);
}

html.home body {
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	justify-content: center;
	font-size: 17px;
	line-height: 1.45;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}

#home {
	box-sizing: border-box;
	width: 100%;
	max-width: 30rem;
	margin: 0 auto;
	padding: 32px 24px;
	padding: max(32px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
}

#home #logo {
	float: right;
	width: 96px;
	height: 114px;
	margin: -6px -8px 8px 12px;
}

#home h1 {
	margin: 12px 0 .25em 0;
	font-size: 48px;
	line-height: 1.1;
	color: #ffffff;
}

#home h2 {
	clear: both;
	margin: 1.6em 0 .8em 0;
	font-size: 20px;
	color: #ffffff;
}

#home p {
	margin: 0 0 1em 0;
}

#home_ourgames {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin: 0 0 1.8em 0;
	padding: 0;
	list-style: none;
}

#home_ourgames a {
	display: block;
	padding: 18px 8px 14px 8px;
	border-radius: 14px;
	background-color: rgba(255, 255, 255, .06);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
	text-align: center;
	text-decoration: none;
	font-weight: bold;
	color: #ffffff;
}

#home_ourgames img {
	display: block;
	width: 96px;
	height: 96px;
	margin: 0 auto 10px auto;
}

@media (hover: hover) {
	#home_ourgames a:hover {
		background-color: rgba(255, 255, 255, .12);
	}
}

#home_ourgames a:active {
	background-color: rgba(255, 255, 255, .16);
}

@media (max-width: 340px) {
	#home #logo {
		width: 72px;
		height: 86px;
	}
	#home h1 {
		font-size: 40px;
	}
}
/* ] HOMEPAGE */

@media (min-width: 700px) and (min-height: 700px) {
	html.home body {
		font-size: 20px;
	}
	#home {
		max-width: 36rem;
	}
	#home h1 {
		font-size: 60px;
	}
	#home h2 {
		font-size: 24px;
	}
	#home #logo {
		width: 120px;
		height: 143px;
	}
	#home_ourgames img {
		width: 128px;
		height: 128px;
	}
}
