/*
 * Responsive layer. Bootstrap's container-xxl owns the outer width;
 * the menu collapses behind a button (<= 991px) and columns stack (<= 767px).
 */

/* The wrapper's margins, background and shadow remain in extra.css. */
img, video, iframe {
	max-width: 100%;
}
img {
	height: auto;
}

/* ---------- Top bar (was inline styles in inc/nav-soulplay.php) ---------- */
.site-topbar {
	padding-left: 40px;
	padding-right: 40px;
}
.site-topbar-inner {
	padding: 8px 0;
}
.site-topbar-inner:after {
	content: "";
	display: table;
	clear: both;
}
.site-topbar-left {
	float: left;
}
.site-topbar-right {
	float: right;
	display: inline;
	margin-left: 10px;
	margin-right: 10px;
	padding-left: 20px;
}

/* ---------- Main menu (was inline styles in inc/nav-soulplay.php) ---------- */
.site-logo img {
	float: left;
	padding: 10px 0 10px 40px;
}
.site-nav #sub-menu {
	padding: 20px 40px 0 0;
	float: right;
}
.site-nav-toggle {
	display: none;
}

/* ---------- Footer (was inline styles in inc/footer-soulplay.php) ---------- */
.site-footer-links {
	float: right;
	margin-top: 15px;
}

/* ---------- Generic overflow guards ---------- */
.registerForm,
.styledselect select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
	max-width: 100%;
}
.container-main {
	width: auto;
	max-width: 960px;
}
/* event winner wheel (the SVG gets a viewBox in event-winner/index.php, so it scales) */
#wheel svg {
	max-width: 100%;
	height: auto;
}

/* ================= Tablet and below: collapsible menu ================= */
@media (max-width: 991px) {
	.boxed-margin {
		margin-top: 0;
		margin-bottom: 0;
		/* safety net: stray decorations (pseudo-elements, shadows) never cause sideways scrolling */
		overflow-x: clip;
	}
	/* wide data tables scroll sideways instead of stretching the page
	   (inc/layout-footer.php wraps each table in .table-scroll) */
	.table-scroll {
		max-width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
	.site-topbar {
		padding-left: 15px;
		padding-right: 15px;
	}
	.site-nav {
		position: relative;
		text-align: left;
	}
	.site-nav:after {
		content: "";
		display: table;
		clear: both;
	}
	.site-logo img {
		padding: 10px 0 10px 15px;
		max-height: 70px;
		width: auto;
	}
	.site-nav-toggle {
		display: block;
		float: right;
		margin: 18px 15px 0 0;
		padding: 8px 14px;
		background: #2c2c2c;
		border: 1px solid #3e4044;
		border-radius: 3px;
		color: #fff;
		font: 700 14px/1 Roboto, sans-serif;
		letter-spacing: 1px;
		text-transform: uppercase;
		cursor: pointer;
	}
	.site-nav-toggle .fa {
		margin-right: 8px;
	}
	.site-nav #sub-menu {
		display: none;
		float: none;
		clear: both;
		width: 100%;
		padding: 0;
		box-sizing: border-box;
		border-top: 1px solid #3e4044;
	}
	.site-nav.is-open #sub-menu {
		display: block;
	}
	.site-nav #sub-menu > ul > li {
		float: none;
		border-bottom: 1px solid #2a2b2e;
	}
	.site-nav #sub-menu > ul > li > a {
		padding: 14px 20px;
	}
	/* buttons inside narrow columns (download page) wrap instead of overflowing */
	.button {
		max-width: 100%;
		box-sizing: border-box;
		white-space: normal;
	}
	/* columns side by side still fit on a tablet, but never wider than the screen */
	.box-top.col-md-3, .box-top.col-md-4, .box-top.col-md-6, .box-top.col-md-8, .box-top.col-md-12 {
		box-sizing: border-box;
		max-width: 100%;
	}
}

/* ================= Phone ================= */
@media (max-width: 767px) {
	body {
		-webkit-text-size-adjust: 100%;
	}
	.site-topbar-left,
	.site-topbar-right {
		float: none;
		display: block;
		margin: 0;
		padding: 2px 0;
		text-align: center;
	}
	/* 15px matches the Bootstrap row gutter, so .row's negative margins don't stick out */
	.content2 {
		padding-left: 15px;
		padding-right: 15px;
	}
	/* reCAPTCHA boxes have an inline margin-left of ~29%; centre them instead */
	.g-recaptcha {
		margin-left: 0 !important;
		display: flex;
		justify-content: center;
	}
	/* event winner: the rewards panel is absolutely positioned beside the wheel (inline styles);
	   on phones it goes below the wheel at full width */
	#rewards {
		position: static !important;
		width: auto !important;
	}
	#rewards .wpb_wrapper {
		padding-left: 0 !important;
	}
	/* profile header: player name and search box stack */
	.content2 > .row.justify-content-between > [class*="col-"] {
		flex: 0 0 100%;
		max-width: 100%;
		margin-bottom: 10px;
	}
	.content-padding {
		padding-left: 10px;
		padding-right: 10px;
	}
	/* stack the old float grid */
	.box-top.col-md-3, .box-top.col-md-4, .box-top.col-md-6, .box-top.col-md-8 {
		width: 100% !important;
		float: none !important;
	}
	.site-footer-logo {
		text-align: center;
	}
	.site-footer-links {
		float: none;
		text-align: center;
		margin: 10px 0 20px;
	}
	/* offset columns (e.g. register, ucp) start at the left edge */
	.box-top.col-md-8, .box-top.col-md-6, .box-top.col-md-4, .box-top.col-md-3 {
		margin-left: 0 !important;
	}
	/* hiscores progress labels: keep them inside their bar */
	.progress {
		position: relative;
	}
	.progress .percent {
		left: 0;
		width: 100%;
	}
	/* events page: play button sits under the banner instead of on top of it */
	.content-box2 .w-promo-games__btn-wrap {
		position: static;
		text-align: center;
		margin: 15px 0;
	}
	/* search / compare boxes (profile): the text field shrinks, the button keeps its size */
	form.d-flex > input[class*="col-"] {
		flex: 1 1 0;
		width: auto;
		min-width: 0;
	}
	form.d-flex > .btn-search {
		flex: 0 0 auto;
		width: auto;
	}
	form.d-flex > * {
		box-sizing: border-box;
	}
	h1 {
		font-size: 26px;
		line-height: 1.25;
	}
	.big-font {
		font-size: 30px;
	}
	/* hiscores-style page headers (hiscores, clues, raids, boss kills, ...) */
	.boxed-margin .hs-header {
		height: auto;
		min-height: 120px;
	}
	.boxed-margin .hs-header h1 {
		font-size: 30px;
		margin-top: 30px;
	}
	.play-now-box {
		height: auto !important;
		min-height: 260px;
		padding-bottom: 20px;
		background-size: cover !important;
	}
}
