/**
 * BACK-1408 phase 1: full-screen game page.
 *
 * Applied only on the plugin's dedicated full-screen template (body carries
 * .wpllmlive-fullscreen-page). Harvested from frontend-overlay.css's mobile
 * rules (dvh viewport, safe-area insets, iOS input zoom guard, keyboard-aware
 * padding) so the mobile handling survives the overlay removal (BACK-1408
 * phase 2). Scoped to the full-screen body so it never affects inline pages.
 */

/* Both selectors are scoped: the template puts .wpllmlive-fullscreen-html on
   <html> and .wpllmlive-fullscreen-page on <body>. A bare `html` selector here
   killed scrolling on every inline game page (BACK-1408 regression). */
html.wpllmlive-fullscreen-html,
body.wpllmlive-fullscreen-page {
	margin: 0;
	padding: 0;
	height: 100%;
	overflow: hidden;
	overscroll-behavior: none;
}

/* The shell fills the viewport. 100vh is the fallback; 100dvh (dynamic
   viewport height) tracks the mobile URL-bar collapse so the game never gets
   clipped or leaves a gap. */
body.wpllmlive-fullscreen-page .wpllmlive-fullscreen-shell {
	position: fixed;
	inset: 0;
	height: 100vh;
	height: 100dvh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

/* Logged-in admin bar offset. */
body.wpllmlive-fullscreen-page.admin-bar .wpllmlive-fullscreen-shell {
	top: 32px;
	height: calc(100vh - 32px);
	height: calc(100dvh - 32px);
}

@media screen and (max-width: 782px) {
	body.wpllmlive-fullscreen-page.admin-bar .wpllmlive-fullscreen-shell {
		top: 46px;
		height: calc(100vh - 46px);
		height: calc(100dvh - 46px);
	}
}

/* The game fills the shell; comfortable max width on desktop, edge-to-edge on
   mobile. */
body.wpllmlive-fullscreen-page .wpllmlive-chat-interface {
	flex: 1 1 auto;
	min-height: 0;
	width: 100%;
	max-width: 960px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
}

body.wpllmlive-fullscreen-page .wpllmlive-chat-container {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
}

/* Transcript scrolls; input stays pinned. */
body.wpllmlive-fullscreen-page .wpllmlive-chat-messages {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

body.wpllmlive-fullscreen-page .wpllmlive-chat-input-area {
	flex: 0 0 auto;
	padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}

/* iOS Safari zooms the page in when a sub-16px input is focused; 16px stops
   it. Mobile only, so desktop keeps its own sizing. */
@media screen and (max-width: 782px) {
	body.wpllmlive-fullscreen-page .wpllmlive-message-input {
		font-size: 16px;
	}
}

/* Nothing inside the shell may cause horizontal scroll. */
body.wpllmlive-fullscreen-page .wpllmlive-fullscreen-shell img,
body.wpllmlive-fullscreen-page .wpllmlive-fullscreen-shell table,
body.wpllmlive-fullscreen-page .wpllmlive-fullscreen-shell pre {
	max-width: 100%;
}
