/* PromptPlay mobile polish */
html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body.pp-theme {
	padding-left: env(safe-area-inset-left);
	padding-right: env(safe-area-inset-right);
}

@media (max-width: 900px) {
	body.pp-theme .forum-main {
		padding-bottom: calc(44px + env(safe-area-inset-bottom));
	}

	body.pp-theme .pp-home-intro {
		padding: 1rem 0.95rem;
	}

	body.pp-theme .pp-home-intro-copy h1 {
		font-size: clamp(1.35rem, 7vw, 1.75rem);
		line-height: 1.2;
	}

	body.pp-theme .pp-home-intro-actions {
		display: flex;
		flex-wrap: wrap;
		gap: 0.5rem;
	}

	body.pp-theme .pp-home-intro-actions .forum-btn {
		flex: 1 1 auto;
		min-width: calc(50% - 0.5rem);
		justify-content: center;
		text-align: center;
	}

	body.pp-theme .pp-home-intro-stats {
		display: grid !important;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 0.45rem;
		width: 100%;
	}

	body.pp-theme .pp-home-intro-stats li {
		min-width: 0;
		padding: 0.55rem 0.35rem;
		text-align: center;
	}

	.pp-featured-grid {
		grid-template-columns: 1fr !important;
		gap: 0.65rem;
	}

	.pp-featured-card {
		min-height: 44px;
		padding: 0.85rem 0.95rem;
	}

	.pp-spotlight {
		padding: 1rem !important;
		gap: 0.85rem !important;
	}

	.pp-spotlight-prompt {
		max-height: 180px;
		font-size: 0.78rem;
	}

	.pp-quests-home,
	.pp-show-home {
		padding: 1rem !important;
		margin: 1rem 0 !important;
	}

	.pp-quests-home-actions,
	.pp-show-home-actions {
		display: flex;
		flex-wrap: wrap;
		gap: 0.5rem;
	}

	.pp-quests-home-actions .forum-btn,
	.pp-show-home-actions .forum-btn {
		flex: 1 1 auto;
		justify-content: center;
		min-height: 44px;
	}

	.pp-quests-head,
	.pp-show-head {
		flex-direction: column;
		align-items: stretch !important;
		gap: 0.75rem !important;
	}

	.pp-quests-head-xp {
		text-align: left !important;
	}

	.pp-quests-grid,
	.pp-show-grid {
		grid-template-columns: 1fr !important;
		gap: 0.75rem !important;
	}

	.pp-quest-card,
	.pp-show-card {
		padding: 0.9rem 1rem;
	}

	.pp-quest-puzzle-form {
		flex-direction: column;
	}

	.pp-quest-puzzle-form input[type="text"],
	.pp-quest-puzzle-form .forum-btn {
		width: 100%;
		min-height: 44px;
	}

	.pp-show-toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.pp-show-toolbar select,
	.pp-show-toolbar .forum-btn {
		width: 100%;
		min-height: 44px;
	}

	.pp-show-detail h1 {
		font-size: 1.35rem !important;
	}

	.pp-show-detail-actions {
		width: 100%;
	}

	.pp-show-detail-actions .forum-btn {
		flex: 1 1 auto;
		justify-content: center;
		min-height: 44px;
	}

	.pp-snippet-code {
		max-height: 280px;
		font-size: 0.78rem;
		-webkit-overflow-scrolling: touch;
	}

	.pp-snippet figcaption {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.25rem;
	}

	.pp-rate-stars label {
		font-size: 1.75rem;
		padding: 0.25rem;
		min-width: 44px;
		min-height: 44px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	.pp-res-grid {
		grid-template-columns: 1fr !important;
	}

	.pp-learn-day {
		grid-template-columns: 1fr !important;
	}

	/* Board / thread lists: avoid cramped last-post column */
	body.pp-theme .forum-board-row .col-last {
		font-size: 0.82rem;
	}

	body.pp-theme .forum-post {
		padding: 0.9rem;
	}

	body.pp-theme .forum-post-meta {
		flex-wrap: wrap;
		gap: 0.35rem 0.75rem;
	}

	/* Touch-friendlier tags */
	body.pp-theme .forum-tag,
	body.pp-theme .forum-tags a {
		min-height: 36px;
		display: inline-flex;
		align-items: center;
		padding-left: 0.65rem;
		padding-right: 0.65rem;
	}

	/* Login / auth cards full width feel */
	body.pp-theme .forum-login-wrap,
	body.pp-theme .forum-auth-wrap {
		padding: 0;
	}

	body.pp-theme .forum-login-card {
		margin: 0 auto;
		max-width: 100%;
	}
}

@media (max-width: 480px) {
	body.pp-theme .pp-home-intro-stats {
		grid-template-columns: 1fr;
	}

	body.pp-theme .pp-home-intro-actions .forum-btn {
		min-width: 100%;
	}

	.pp-xp-badge {
		flex-wrap: wrap;
	}
}

/* Prefer reduced motion already handled in standalone; keep tap highlight subtle */
body.pp-theme a,
body.pp-theme button {
	-webkit-tap-highlight-color: rgba(46, 230, 255, 0.18);
}
