/* On-screen controls: mode switch, analog stick and up/down buttons, bottom left above the notch bar.
   Uses the notch colors from nav.css. */
.handpad {
	position: fixed; z-index: 5;
	left: calc( var(--notch-frame) + 16px ); bottom: calc( var(--notch-frame) + 64px );
	display: flex; align-items: center; gap: 12px;
	user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
	-webkit-tap-highlight-color: transparent;
	transition: opacity .2s, transform .35s var(--notch-spring), visibility 0s;
}
.handpad.off {
	opacity: 0; visibility: hidden; transform: translateY( 8px ) scale( .97 );
	transition: opacity .2s, transform .35s var(--notch-spring), visibility 0s .35s;
}
.handpad svg {
	width: 22px; height: 22px;
	fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}

.handpad-stick {
	position: relative; width: 112px; height: 112px; border-radius: 50%;
	background: rgba( 9, 9, 11, .3 ); box-shadow: inset 0 0 0 2px rgba( 9, 9, 11, .15 );
	backdrop-filter: blur( 4px ); -webkit-backdrop-filter: blur( 4px );
	touch-action: none; cursor: grab;
}
.handpad-knob {
	position: absolute; left: 50%; top: 50%;
	width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%;
	background: var(--notch-ink); box-shadow: 0 4px 12px rgba( 0, 0, 0, .3 ), inset 0 0 0 3px var(--notch-raised);
	transition: transform .3s var(--notch-spring);
	pointer-events: none;
}
.handpad-stick.active { cursor: grabbing; }
.handpad-stick.active .handpad-knob { transition: none; }

/* Round buttons: the mode switch on the left, the lift buttons on the right */
.handpad-mode, .handpad-lift { display: flex; flex-direction: column; gap: 8px; }
.handpad-mode button, .handpad-lift button {
	display: grid; place-items: center; width: 48px; height: 48px; margin: 0; padding: 0;
	border: 0; border-radius: 50%; outline: none;
	background: var(--notch-ink); color: var(--notch-text); box-shadow: 0 4px 12px rgba( 0, 0, 0, .3 );
	cursor: pointer; touch-action: none; transition: background .15s, color .15s, transform .15s;
}
.handpad-mode button:hover, .handpad-lift button:hover { background: #18181b; }
.handpad-mode button:focus-visible, .handpad-lift button:focus-visible { box-shadow: 0 0 0 2px #71717a; }
.handpad-lift button.active { background: var(--notch-raised); transform: scale( .92 ); }

/* The active mode is the light button */
.handpad-mode button { color: var(--notch-muted); }
.handpad-mode button[aria-pressed="true"] { background: var(--notch-text); color: var(--notch-ink); }
.handpad-mode button[aria-pressed="true"]:hover { background: #ffffff; }

/* Lifting the hand means nothing while walking */
.handpad-lift { transition: opacity .2s, visibility 0s; }
.handpad.walk .handpad-lift { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s, visibility 0s .2s; }

@media ( max-width: 767px ) {
	.handpad { left: 12px; bottom: 56px; gap: 10px; }
	.handpad-stick { width: 96px; height: 96px; }
	.handpad-knob { width: 42px; height: 42px; margin: -21px 0 0 -21px; }
	.handpad-mode button, .handpad-lift button { width: 42px; height: 42px; }
}
