/*
 * responsive.css — mobile layout overrides.
 *
 * Loaded LAST (after every page's own stylesheet, see header.html) so these
 * @media rules win the cascade. Desktop (>= 992px) is untouched; everything
 * here only applies on phones/tablets. Kept deliberately small and readable so
 * a Greasemonkey/userstyle tweak can override any single rule.
 *
 * The drawer is toggled by adding/removing `nav-open` on <body> (see the
 * hamburger button in viewer-header.html). No JS framework needed.
 */

/* Backdrop is hidden everywhere by default; only the mobile rules below ever
   reveal it (when the drawer is open). */
#navBackdrop {
	display: none;
}

/* ============ Phones & small tablets (< lg / 992px) ============ */
@media (max-width: 991.98px) {

	/* The left sidebar becomes an off-canvas drawer that slides in. */
	nav {
		left: -250px;
		transition: left 0.2s ease-in-out;
		z-index: 1045;
	}
	body.nav-open nav {
		left: 0;
	}

	/* Dim/click-to-close backdrop behind the open drawer (below the header). */
	body.nav-open #navBackdrop {
		display: block;
		position: fixed;
		top: 6rem;
		left: 0;
		right: 0;
		bottom: 0;
		background: rgba(0, 0, 0, 0.5);
		z-index: 1040;
	}

	/* Content spans the full width (no sidebar / chat gutters) and grows with
	   its content instead of being locked to one viewport height. Covers the
	   duplicated `main` rules in main.css / leaderboard.css / channel.css. */
	main {
		margin-left: 0 !important;
		margin-right: 0 !important;
		height: auto !important;
	}

	/* Channel page: the chat panel stacks under the player instead of being a
	   fixed 350px column overlapping the content. */
	#chat {
		position: static !important;
		width: 100% !important;
		top: auto;
	}
	#chatiFrame {
		height: 70vh !important;
	}

	/* Leaderboard: shrink the oversized type so long names don't overflow. */
	main .table {
		font-size: 1rem;
	}
	main h1 {
		font-size: 1.6rem;
	}
}
