/* Game buttons must remain usable when held on iOS and Android. */
#match-game button,
#match-game button *,
#match-game select,
#match-game summary,
#word-rally button,
#word-rally button *,
#word-rally select,
#word-rally summary,
.game-player.letter-storm button,
.game-player.letter-storm button *,
.game-player.letter-storm select,
.game-player.letter-storm summary {
	-webkit-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
	touch-action: manipulation;
}
/* Only active steering gestures take ownership of the touch. */
#word-rally[data-play-state="running"] .rally-controls,
#word-rally[data-play-state="running"] .rally-controls button,
.game-player.letter-storm[data-play-state="running"] .touch-controls,
.game-player.letter-storm[data-play-state="running"] .touch-controls button {
	touch-action: none;
}
#word-rally[data-play-state]:not([data-play-state="running"]) canvas,
#word-rally[data-play-state]:not([data-play-state="running"]) .rally-controls,
#word-rally[data-play-state]:not([data-play-state="running"]) .rally-controls button,
.game-player.letter-storm[data-play-state]:not([data-play-state="running"]) canvas,
.game-player.letter-storm[data-play-state]:not([data-play-state="running"]) .touch-controls,
.game-player.letter-storm[data-play-state]:not([data-play-state="running"]) .touch-controls button {
	touch-action: pan-y;
}
html.phone-play-locked,
body.phone-play-locked {
	overflow: hidden;
	overscroll-behavior: none;
}
#word-rally.phone-play-active,
.game-player.letter-storm.phone-play-active {
	position: fixed;
	z-index: 10000;
	top: var(--phone-top, 0px);
	left: var(--phone-left, 0px);
	width: var(--phone-width);
	height: var(--phone-height);
	max-height: 100svh;
	max-width: none;
	box-sizing: border-box;
	margin: 0;
	padding: calc(8px + env(safe-area-inset-top, 0px)) calc(8px + env(safe-area-inset-right, 0px))
		calc(8px + env(safe-area-inset-bottom, 0px)) calc(8px + env(safe-area-inset-left, 0px));
	background: #fff;
	overflow: hidden;
	touch-action: none;
	overscroll-behavior: none;
	transform: none;
}
#word-rally.phone-play-active .rally-settings,
.game-player.letter-storm.phone-play-active .settings,
#word-rally.phone-play-active #message {
	display: none;
}
#word-rally.phone-play-active .rally-stage,
.game-player.letter-storm.phone-play-active .arcade-stage {
	margin: 0 auto;
	max-width: 100%;
	min-height: 0;
	scroll-margin: 0;
}
#word-rally.phone-play-active .rally-hud,
.game-player.letter-storm.phone-play-active .stats {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
	align-items: center;
	gap: 4px 8px;
	padding: 6px 8px;
}
#word-rally.phone-play-active .rally-hud > span:first-child,
.game-player.letter-storm.phone-play-active .stats > span:first-child {
	grid-column: 1;
	grid-row: 1;
}
#word-rally.phone-play-active .rally-hud > span:nth-child(3),
.game-player.letter-storm.phone-play-active .stats > span:nth-child(3) {
	grid-column: 2;
	grid-row: 1;
	text-align: right;
}
#word-rally.phone-play-active #mission,
.game-player.letter-storm.phone-play-active #mission {
	grid-column: 1/-1;
	grid-row: 2;
	text-align: center;
	font-size: 14px;
	line-height: 1.25;
}
#word-rally.phone-play-active #pause,
.game-player.letter-storm.phone-play-active #pause {
	grid-column: 3;
	grid-row: 1;
	min-width: 74px;
	min-height: 44px;
	margin: 0;
	padding: 6px 10px;
	font-size: 16px;
	letter-spacing: 0;
	white-space: nowrap;
}
/* Pausing restores document scrolling, while keeping the saved board width/height. */
#word-rally.phone-play-paused,
.game-player.letter-storm.phone-play-paused {
	position: relative;
	left: 50%;
	transform: translateX(-50%);
	width: var(--phone-width);
	max-width: none;
	box-sizing: border-box;
	padding: calc(8px + env(safe-area-inset-top, 0px)) calc(8px + env(safe-area-inset-right, 0px))
		calc(8px + env(safe-area-inset-bottom, 0px)) calc(8px + env(safe-area-inset-left, 0px));
	touch-action: auto;
}
#word-rally.phone-play-paused .rally-stage,
.game-player.letter-storm.phone-play-paused .arcade-stage {
	scroll-margin-top: 56px;
}

#content .game-player.letter-storm.phone-play-active .stats {
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.game-player.letter-storm.phone-play-active .canvas-wrap,
.game-player.letter-storm.phone-play-paused .canvas-wrap {
	margin-inline: auto;
}

#word-rally.phone-play-active .rally-hud > span:first-child,
#word-rally.phone-play-active .rally-hud > span:nth-child(3),
.game-player.letter-storm.phone-play-active .stats > span:first-child,
.game-player.letter-storm.phone-play-active .stats > span:nth-child(3) {
	font-size: 14px;
	line-height: 1.2;
}
#word-rally.phone-play-active .rally-hud > span:first-child strong,
#word-rally.phone-play-active .rally-hud > span:nth-child(3) strong,
.game-player.letter-storm.phone-play-active .stats > span:first-child strong,
.game-player.letter-storm.phone-play-active .stats > span:nth-child(3) strong {
	display: block;
	margin-left: 0;
}
