/* Daily Upgrade: core */
.umdu-enabled {
	--umdu-accent: #7a1b1b;
	--umdu-bg: #fbf7f1;
	--umdu-text: #211b18;
	--umdu-muted: #706761;
	--umdu-border: rgba(74, 51, 42, 0.17);
	--umdu-shadow: 0 18px 55px rgba(28, 16, 12, 0.2);
}

.umdu-sr-status {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.umdu-preview-badge {
	position: fixed;
	z-index: 99999;
	left: 12px;
	bottom: 12px;
	padding: 0.3rem 0.65rem;
	border-radius: 999px;
	background: #1d2327;
	color: #fff;
	font: 600 12px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	letter-spacing: 0.02em;
	pointer-events: none;
}

.umdu-reader-settings {
	margin: 0;
	padding: 0.75rem 1rem;
	border: 1px solid var(--umdu-border);
	border-radius: 12px;
	color: var(--umdu-text);
}

.umdu-reader-settings__row {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	min-height: 44px;
}

/* Play mode: one fixed overlay, sized with svh so it never resizes as the
   browser's bars come and go, clear of the notch when a theme adds
   viewport-fit=cover. The page underneath is scroll-locked. */
html.umdu-play-open,
html.umdu-play-open body {
	overflow: hidden;
}

html.umdu-play-open body {
	position: fixed;
	left: 0;
	right: 0;
	width: 100%;
}

.umdu-play {
	position: fixed;
	z-index: 100000;
	inset: 0;
	height: 100vh;
	height: 100svh;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
	overflow: hidden;
	overscroll-behavior: contain;
	background: var(--umdu-bg);
	color: var(--umdu-text);
	font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.umdu-play *,
.umdu-play *::before,
.umdu-play *::after {
	box-sizing: border-box;
}

.umdu-play__bar {
	display: flex;
	flex: none;
	gap: 0.5rem;
	align-items: center;
	min-height: 44px;
}

.umdu-play__close,
.umdu-play__sound,
.umdu-play__gear {
	min-width: 44px;
	min-height: 44px;
	padding: 0 0.75rem;
	border: 1px solid var(--umdu-border);
	border-radius: 10px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	touch-action: manipulation;
}

/* Themes restyle every button:hover and :focus (GeneratePress: white on dark grey); a button here keeps its own colours. */
.umdu-play__close:hover,
.umdu-play__close:focus,
.umdu-play__sound:hover,
.umdu-play__sound:focus,
.umdu-play__gear:hover,
.umdu-play__gear:focus {
	background: transparent;
	color: inherit;
}

/* The speaker: muted until "Sound effects" is on, then the accent with its waves. */
.umdu-play__sound {
	display: inline-grid;
	place-items: center;
	padding: 0;
	color: var(--umdu-muted);
}

.umdu-play__sound[hidden] {
	display: none;
}

.umdu-play__sound[aria-pressed="true"],
.umdu-play__sound[aria-pressed="true"]:hover,
.umdu-play__sound[aria-pressed="true"]:focus {
	border-color: var(--umdu-accent);
	background: color-mix(in srgb, var(--umdu-accent) 10%, transparent);
	color: var(--umdu-accent);
}

.umdu-play__sound[aria-pressed="true"] .umdu-play__muted,
.umdu-play__sound[aria-pressed="false"] .umdu-play__waves {
	display: none;
}

.umdu-play__sound:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--umdu-accent) 55%, transparent);
	outline-offset: 2px;
}

.umdu-play__title {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	font-weight: 800;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.umdu-play__status {
	font-variant-numeric: tabular-nums;
	font-weight: 700;
}

.umdu-play__settings {
	flex: none;
	margin-top: 0.5rem;
}

.umdu-play__banner {
	flex: none;
	margin: 0.5rem 0 0;
	padding: 0.4rem 0.75rem;
	border-radius: 10px;
	background: rgba(0, 0, 0, 0.06);
	font-size: 0.9rem;
}

.umdu-play__stage {
	flex: 1;
	min-height: 0;
	margin-top: 0.75rem;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	touch-action: pan-y;
	-webkit-overflow-scrolling: touch;
}

/* An engine's playfield inside the stage: gestures are the game's. */
.umdu-playfield {
	touch-action: none;
	-webkit-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
}

.umdu-play__controls {
	flex: none;
	padding: 0 4px;
	touch-action: manipulation;
}

.umdu-play__controls:empty {
	display: none;
}

.umdu-play__message {
	display: grid;
	gap: 1rem;
	place-items: center;
	min-height: 40%;
	text-align: center;
}

/* Play mode moves focus to headings and boxes (tabindex="-1") so screen
   readers announce them; they aren't controls, so no focus ring. */
.umdu-play [tabindex="-1"]:focus,
.umdu-play [tabindex="-1"]:focus-visible {
	outline: none;
	box-shadow: none;
}
