/*
	Touch handling for Safari on iOS/iPadOS (product owner report: iPhone 14 Pro, laggy/inconsistent
	drag-to-scroll). Avalonia.Browser's own createAvaloniaHost already sets touch-action: none and
	overflow: hidden inline on #out at runtime (Avalonia.Browser 12.1.0's avalonia.js), which is
	enough on its own since touch-action restricts descendants too - the rules below are a
	belt-and-suspenders CSS-level match (covering the moment before that inline style is applied, and
	the splash screen shown before it) plus the properties Avalonia does not set at all:
	-webkit-user-select/-webkit-touch-callout (native text-selection/callout popovers) and
	overscroll-behavior (page-level rubber-banding/pull-to-refresh chaining past the app).
*/
/* Non-scrollable (but not position: fixed, which makes iOS Safari drop the keyboard) - see main.js's
   pinHostToVisualViewport (iOS keyboard tap-coordinate bug hunt). */
html, body {
	height: 100%;
	overflow: hidden;
	overscroll-behavior: none;
}

/* avalonia.js places its hidden text input under the caret (setBounds, inline styles); low on the screen,
   iOS pans the page to keep it above the keyboard and every later tap lands off by the pan. Pinned to the
   top, iOS has nothing to pan, so canvas and touch coordinates stay aligned. */
.avalonia-input-element {
	top: 0 !important;
	left: 0 !important;
}

#out, #out canvas {
	touch-action: none;
	-webkit-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
}

/*
	The loading screen shown before the Avalonia runtime mounts its canvas into #out
	(PHONE-DESIGN.md §7). Backgrounds are static copies of MastersGraphite's own SurfacePage token
	(build/tokens/MastersGraphite.tsv in MastersTransportation.Shared.UI.Avalonia), since the kit's
	tokens are not available before the runtime starts.
*/
.app-splash {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: 'Barlow', 'Outfit', sans-serif;
    pointer-events: none;
    transition: opacity 200ms ease-out;
}

@media (prefers-color-scheme: light) {
    .app-splash {
        background: #f4f7f8;
        color: #1b2a4e;
    }
}

@media (prefers-color-scheme: dark) {
    .app-splash {
        background: #161b20;
        color: #ffffff;
    }
}

.app-splash-title {
    font-size: 1.25rem;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.app-splash-status {
    min-height: 1.2em;
    font-size: 0.8125rem;
    opacity: 0.75;
    text-align: center;
    padding: 0 24px;
}

/* Revealed after 8 s via animation-delay, not a JS setTimeout, so it needs nothing running on the
   page beyond CSS having parsed (PHONE-DESIGN.md §7: "After 8 s it adds..."). */
.app-splash-status-slow {
    display: block;
    margin-top: 4px;
    opacity: 0;
    animation: app-splash-reveal 0s 8s forwards;
}

@media (prefers-reduced-motion: reduce) {
    .app-splash-status-slow {
        animation-duration: 0s;
        animation-delay: 8s;
    }
}

@keyframes app-splash-reveal {
    to { opacity: 1; }
}

/* Toggled by index.html's own inline script once the Avalonia canvas mounts into #out. */
.app-splash.splash-close {
    opacity: 0;
}
