/* Leaky Miata
   Kleuren volgen de Roadsterclub-tokens. De hex-waarden zijn de fallback
   uit rsc-tokens.css wanneer die variabelen op de pagina ontbreken. */

.rsc-leaky {
	--lm-text: var(--rsc-text, #1c1516);
	--lm-muted: var(--rsc-text-muted, #667085);
	--lm-bg: var(--rsc-background, #fbf8f7);
	--lm-bg-bright: var(--rsc-background-bright, #fbf8f7);
	--lm-brand: var(--rsc-brand, #b41624);
	--lm-orange: var(--rsc-brand-orange, #ff6b1a);
	--lm-shadow: var(--rsc-boxshadow2, #00000040);
	--lm-toast-shadow: var(--rsc-boxshadow, #12121260);

	box-sizing: border-box;
	max-width: 420px;
	margin: 0 auto;
	color: var(--lm-text);
	font-family: inherit;
}

html[data-theme="dark"] .rsc-leaky {
	--lm-text: var(--rsc-text, #fbf8f7);
	--lm-bg: var(--rsc-background, #121212);
	--lm-bg-bright: var(--rsc-background-bright, #fbf8f7);
	--lm-shadow: var(--rsc-boxshadow2, #fbf8f71f);
}

.rsc-leaky *,
.rsc-leaky *::before,
.rsc-leaky *::after {
	box-sizing: border-box;
}

.rsc-leaky [hidden] {
	display: none !important;
}

.rsc-leaky__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 0;
}

.rsc-leaky__tools {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
}

.rsc-leaky__score {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--lm-text);
}

.rsc-leaky__tempo {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 10px;
}

.rsc-leaky__tempo-label,
.rsc-leaky__tempo-value {
	flex: 0 0 auto;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	color: var(--lm-text);
}

.rsc-leaky__tempo-value {
	min-width: 1.25em;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.rsc-leaky input.rsc-leaky__speed {
	flex: 1 1 auto;
	width: auto !important;
	min-width: 0;
	height: 28px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	box-shadow: none;
	accent-color: var(--lm-brand);
	cursor: pointer;
}

.rsc-leaky button {
	appearance: none;
	-webkit-appearance: none;
	margin: 0;
	font-family: inherit;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	box-shadow: none;
	background-image: none;
	float: none;
	width: auto;
	max-width: none;
	cursor: pointer;
}

.rsc-leaky button.rsc-leaky__round {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	flex: 0 0 44px !important;
	width: 44px !important;
	min-width: 44px !important;
	max-width: 44px !important;
	height: 44px !important;
	min-height: 44px !important;
	padding: 0 !important;
	border: 1px solid var(--lm-text);
	border-radius: 50% !important;
	background: var(--lm-bg);
	color: var(--lm-text);
	line-height: 1;
	aspect-ratio: 1;
}

.rsc-leaky__round:disabled {
	opacity: 0.4;
	cursor: default;
}

.rsc-leaky__mute[aria-pressed="true"] .rsc-leaky__icon--on,
.rsc-leaky__mute[aria-pressed="false"] .rsc-leaky__icon--off,
.rsc-leaky__pause[data-icon="play"] .rsc-leaky__icon--pause,
.rsc-leaky__pause[data-icon="pause"] .rsc-leaky__icon--play {
	display: none;
}

.rsc-leaky__stage {
	position: relative;
	width: min(100%, 62dvh);
	margin: 12px auto 0;
	aspect-ratio: 1;
	background: #858581;
	box-shadow: 0 4px 12px var(--lm-shadow);
	touch-action: manipulation;
	overscroll-behavior: contain;
	user-select: none;
}

.rsc-leaky__stage--live,
.rsc-leaky__stage--live .rsc-leaky__board {
	touch-action: none;
}

.rsc-leaky__board {
	display: block;
	width: 100%;
	height: 100%;
	touch-action: manipulation;
}

.rsc-leaky__fuel {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 10px;
}

.rsc-leaky__fuel-label {
	flex: 0 0 auto;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	color: var(--lm-text);
}

.rsc-leaky__fuel-track {
	flex: 1 1 auto;
	height: 8px;
	border-radius: 999px;
	background: var(--rsc-background2, #edeeef);
	overflow: hidden;
}

html[data-theme="dark"] .rsc-leaky__fuel-track {
	background: var(--rsc-background2, #1d1d1d);
}

.rsc-leaky__fuel-fill {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 999px;
	background: var(--lm-brand);
}

.rsc-leaky__speed:disabled {
	opacity: 0.45;
	cursor: default;
}

.rsc-leaky__toast {
	position: absolute;
	z-index: 3;
	top: 12px;
	left: 50%;
	transform: translateX(-50%);
	margin: 0;
	padding: 10px 14px;
	border-radius: 999px;
	background: var(--rsc-text, #1c1516);
	color: var(--rsc-background, #fbf8f7);
	box-shadow: 0 8px 28px var(--lm-toast-shadow);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	pointer-events: none;
}

html[data-theme="dark"] .rsc-leaky__toast {
	background: var(--rsc-background, #121212);
	color: var(--rsc-text, #fbf8f7);
}

.rsc-leaky__overlay {
	position: absolute;
	z-index: 2;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(18, 18, 18, 0.55);
}

.rsc-leaky__card {
	width: min(100%, 300px);
	padding: 22px 18px 18px;
	background: var(--lm-bg);
	color: var(--lm-text);
	border-top: 2px solid var(--lm-brand);
	box-shadow: 0 4px 12px var(--lm-shadow);
	text-align: center;
}

.rsc-leaky__heading {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--lm-text);
}

.rsc-leaky__heading--perfect {
	color: var(--lm-brand);
}

.rsc-leaky__line {
	margin: 0 0 16px;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.45;
	color: var(--lm-text);
}

.rsc-leaky__hint {
	margin: 0 0 14px;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.4;
	color: var(--lm-muted);
}

.rsc-leaky button.rsc-leaky__action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 13px 26px;
	border: 1px solid var(--lm-text) !important;
	border-radius: 999px;
	outline: none !important;
	box-shadow: none !important;
	background: var(--lm-bg);
	color: var(--lm-text) !important;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	transition:
		transform 125ms ease,
		color 125ms ease,
		background-color 125ms ease,
		border-color 125ms ease;
}

.rsc-leaky__pad {
	display: none;
	position: relative;
	width: 180px;
	height: 140px;
	margin: 16px auto 0;
	user-select: none;
}

.rsc-leaky button.rsc-leaky__key {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	position: absolute;
	width: 52px !important;
	min-width: 52px !important;
	max-width: 52px !important;
	height: 52px !important;
	min-height: 52px !important;
	padding: 0 !important;
	border: 1px solid var(--lm-text);
	border-radius: 999px;
	background: var(--lm-bg);
	color: var(--lm-text);
}

.rsc-leaky__key[data-dir="up"] { left: 64px; top: 0; }
.rsc-leaky__key[data-dir="left"] { left: 0; top: 44px; }
.rsc-leaky__key[data-dir="right"] { right: 0; top: 44px; }
.rsc-leaky__key[data-dir="down"] { left: 64px; bottom: 0; }

.rsc-leaky__key[data-dir="right"] svg { transform: rotate(90deg); }
.rsc-leaky__key[data-dir="down"] svg { transform: rotate(180deg); }
.rsc-leaky__key[data-dir="left"] svg { transform: rotate(-90deg); }

.rsc-leaky__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.rsc-leaky__noscript {
	margin: 12px 0 0;
	text-align: center;
	font-size: 14px;
	color: var(--lm-muted);
}

@media (hover: hover) and (pointer: fine) {
	.rsc-leaky__round:hover:not(:disabled),
	.rsc-leaky__key:hover {
		color: var(--lm-brand);
		border-color: var(--lm-brand);
	}

	.rsc-leaky button.rsc-leaky__action:hover {
		color: var(--lm-brand) !important;
		border-color: var(--lm-brand) !important;
		transform: scale(1.05);
	}
}

.rsc-leaky__round:focus-visible,
.rsc-leaky__key:focus-visible,
.rsc-leaky__stage:focus-visible,
.rsc-leaky__speed:focus-visible {
	outline: 2px solid var(--lm-brand);
	outline-offset: 3px;
}

.rsc-leaky button.rsc-leaky__action:focus,
.rsc-leaky button.rsc-leaky__action:focus-visible {
	outline: none !important;
	box-shadow: none !important;
}

@media (pointer: coarse), (hover: none) {
	.rsc-leaky__pad {
		display: block;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rsc-leaky button.rsc-leaky__action {
		transition: none;
	}

	.rsc-leaky button.rsc-leaky__action:hover {
		transform: none;
	}
}

@media print {
	.rsc-leaky__stage,
	.rsc-leaky__pad,
	.rsc-leaky__tools {
		display: none;
	}
}
