/* Regatta Duisburg – "Regattastrecke": schematic 2000 m course with traffic rules.
 * Colours follow the theme variables (--color-*, --font-*). Override e.g. .rdc { --rdc-water: #6eebfc; }
 */
.rdc {
	--rdc-navy: var(--color-dark, #14206c);
	--rdc-ground: #121d63;
	--rdc-water: var(--color-primary, #2e6cf1);
	--rdc-island: #14206c;
	--rdc-place: #ff6a00;
	--rdc-lime: var(--color-secondary, #d9ff03);
	--rdc-text: #fff;
	--rdc-muted: rgba(255, 255, 255, 0.68);
	--rdc-font-heading: var(--font-heading, "made_outer_sans_alt", "DM Sans", sans-serif);
	--rdc-font-body: var(--font-body, "DM Sans", sans-serif);
	--rdc-radius: 24px;

	container-type: inline-size;
	position: relative;
	isolation: isolate;
	box-sizing: border-box;
	min-width: 0;
	padding: clamp(20px, 4cqi, 48px);
	border-radius: var(--rdc-radius);
	background:
		radial-gradient(120% 80% at 80% 0%, rgba(46, 108, 241, 0.25), transparent 60%),
		var(--rdc-ground);
	color: var(--rdc-text);
	font-family: var(--rdc-font-body);
	line-height: 1.4;
}

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

/* ------------------------------------------------------------ Oar wheel (as in the hotel list and the shuttle)
 * The Regatta Duisburg wheel in the top right corner: the half wheel /brand/oars.png plus its mirror image on
 * the same axis, the lower left quarter shown; --rdc-wheel-u = 1 image pixel. Behind the content. */
.rdc .rdc__wheel {
	--rdc-wheel-r: clamp(150px, 30cqi, 300px);
	--rdc-wheel-u: calc(var(--rdc-wheel-r) / 320);
	position: absolute;
	z-index: -1;
	top: 0;
	right: 0;
	width: calc(var(--rdc-wheel-u) * 351);
	height: calc(var(--rdc-wheel-u) * 348);
	max-height: 100%;
	overflow: hidden;
	border-top-right-radius: var(--rdc-radius);
	color: var(--rdc-wheel-color, #406ce6);
	opacity: 0.35;
	pointer-events: none;
}

.rdc .rdc__wheel::before,
.rdc .rdc__wheel::after {
	content: "";
	position: absolute;
	top: calc(var(--rdc-wheel-u) * -292);
	width: calc(var(--rdc-wheel-u) * 335);
	height: calc(var(--rdc-wheel-u) * 640);
	background: currentColor;
	-webkit-mask: url(/brand/oars.png) center / contain no-repeat;
	mask: url(/brand/oars.png) center / contain no-repeat;
}

.rdc .rdc__wheel::before {
	left: 0;
}

.rdc .rdc__wheel::after {
	left: calc(var(--rdc-wheel-u) * 307);
	transform: scaleX(-1);
}

.rdc__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
}

.rdc .rdc__title {
	margin: 0;
	color: var(--rdc-lime);
	font-family: var(--rdc-font-heading);
	font-size: clamp(22px, 4cqi, 40px);
	font-weight: 400;
	line-height: 1;
	text-transform: uppercase;
}

.rdc__note {
	margin: 8px 0 14px;
	color: var(--rdc-muted);
	font-size: 13px;
}

.rdc__export {
	margin-left: auto;
}

.rdc__toggle {
	display: grid;
	flex: 0 0 auto;
	place-items: center;
	width: 38px;
	height: 38px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
	color: var(--rdc-lime);
	cursor: pointer;
}

.rdc__toggle:hover,
.rdc__toggle:focus-visible {
	background: var(--rdc-lime);
	color: var(--rdc-navy);
	outline: none;
}

.rdc__toggle svg { width: 18px; height: 18px; fill: currentColor; }
.rdc__toggle .rdc-i-play { display: none; }
.rdc.is-paused .rdc__toggle .rdc-i-play { display: block; }
.rdc.is-paused .rdc__toggle .rdc-i-pause { display: none; }

.rdc__svg {
	display: block;
	width: 100%;
	height: auto;
}

/* Phones: vertical course (start at the top), like the printed traffic rules. */
.rdc__svg--v {
	display: none;
}

@container (max-width: 600px) {
	.rdc__svg--h {
		display: none;
	}

	.rdc__svg--v {
		display: block;
		max-width: 460px;
		margin: 0 auto;
	}
}

.rdc__svg--v .rdc__dist {
	text-anchor: end;
	dominant-baseline: central;
}

/* ------------------------------------------------------------ Course drawing (2000 units wide) */
.rdc__water {
	fill: var(--rdc-water);
	stroke: var(--rdc-island);
	stroke-linejoin: round;
}

.rdc__island { fill: var(--rdc-island); }
.rdc__lime { fill: var(--rdc-lime); }

.rdc__lane,
.rdc__marker {
	stroke: var(--rdc-lime);
	stroke-width: 3.6;
}

.rdc__lane-num,
.rdc__dist {
	font-family: var(--rdc-font-body);
	font-weight: 700;
}

.rdc__lane-num {
	fill: var(--rdc-lime);
	font-size: 22px;
	text-anchor: middle;
	dominant-baseline: central;
}

.rdc__dist {
	fill: #fff;
	font-size: 26px;
	text-anchor: middle;
}

.rdc__dist.is-edge { fill: var(--rdc-lime); }

/* ------------------------------------------------------------ Traffic rules */
.rdc-arrow {
	transition: opacity 0.2s ease;
}

.rdc-arrow__line {
	fill: none;
	stroke: var(--rdc-c, #fff);
	stroke-width: 5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.rdc-arrow__head {
	fill: var(--rdc-c, #fff);
}

.rdc__marks > g {
	transition: opacity 0.2s ease;
}

/* Notes on arrows / boats: wider hit area, small "i" marker, tooltip */
.rdc__body {
	position: relative;
}

.rdc-arrow__hit {
	fill: none;
	stroke: transparent;
	stroke-width: 28;
	stroke-linecap: round;
	stroke-linejoin: round;
}

[data-rdc-note] {
	cursor: help;
	outline: none;
}

.rdc-info circle {
	fill: var(--rdc-lime);
	stroke: var(--rdc-navy);
	stroke-width: 2;
}

.rdc-info text {
	fill: var(--rdc-navy);
	font: 700 16px var(--rdc-font-body);
	text-anchor: middle;
}

[data-rdc-note].is-tip .rdc-arrow__line {
	stroke-width: 7;
}

[data-rdc-note]:focus-visible .rdc-mark,
[data-rdc-note]:focus-visible .rdc-arrow__line {
	filter: drop-shadow(0 0 4px var(--rdc-lime));
}

.rdc__tip {
	position: absolute;
	z-index: 3;
	left: 0;
	top: 0;
	max-width: min(320px, 80%);
	padding: 7px 12px;
	border-radius: 10px;
	background: var(--rdc-lime);
	color: var(--rdc-navy);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
	pointer-events: none;
	transform: translate(-50%, calc(-100% - 12px));
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.rdc__tip[hidden] {
	display: none;
}

/* Legend */
.rdc .rdc__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 10px;
	margin: 14px 0 0;
	padding: 0;
	list-style: none;
}

.rdc .rdc__legend li {
	margin: 0;
	padding: 0;
}

.rdc-key {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 36px;
	margin: 0;
	padding: 4px 12px 4px 8px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 999px;
	background: transparent;
	color: #fff;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.rdc-key:hover,
.rdc-key:focus-visible,
.rdc-key.is-active {
	border-color: var(--rdc-lime);
	background: rgba(217, 255, 3, 0.12);
	outline: none;
}

.rdc-key[aria-pressed="true"] {
	background: var(--rdc-lime);
	color: var(--rdc-navy);
}

/* Icons on water blue – the colour all arrows are drawn on (keeps e.g. navy arrows visible). */
.rdc-key__icon {
	flex: 0 0 auto;
	width: 40px;
	height: 22px;
	padding: 3px 4px;
	border-radius: 6px;
	background: var(--rdc-water);
	overflow: visible;
}

/* Highlight one type: dim the other arrows and boats. */
.rdc.has-active .rdc-arrow:not(.is-active),
.rdc.has-active .rdc__marks > g:not(.is-active) {
	opacity: 0.18;
}

.rdc.has-active .rdc-arrow.is-active .rdc-arrow__line {
	stroke-width: 7;
}

/* Blocked areas: red hatching */
.rdc-hatch__bg { fill: rgba(227, 0, 27, 0.22); }
.rdc-hatch__line { fill: rgba(227, 0, 27, 0.7); }

.rdc-area__line {
	fill: none;
	stroke: #e3001b;
	stroke-width: 3;
	stroke-linejoin: round;
}

.rdc__areas > g {
	transition: opacity 0.2s ease;
}

.rdc.has-active .rdc__areas > g:not(.is-active) {
	opacity: 0.18;
}

[data-rdc-note].is-tip .rdc-area__line,
[data-rdc-note]:focus-visible .rdc-area__line {
	stroke-width: 5;
}

/* Text boxes: plain text in the colour of the lane numbers */
.rdc-textbox text {
	fill: var(--rdc-lime);
	font-family: var(--rdc-font-body);
	font-weight: 700;
	text-anchor: middle;
}

.rdc.has-active .rdc__texts {
	opacity: 0.18;
	transition: opacity 0.2s ease;
}

/* ------------------------------------------------------------ Racing boats (loop; duration and direction per lane inline) */
.rdc-boat__hull { fill: #fff; opacity: 0.85; }
.rdc-boat__oars { stroke: var(--rdc-lime); stroke-width: 1.4; stroke-linecap: round; }

.rdc-boat {
	animation: rdc-race 11s cubic-bezier(0.3, 0.1, 0.4, 1) infinite;
}

@keyframes rdc-race {
	0% { transform: translateX(0); opacity: 0; }
	4% { opacity: 1; }
	92% { transform: translateX(var(--rdc-dist)); opacity: 1; }
	100% { transform: translateX(var(--rdc-dist)); opacity: 0; }
}

.rdc.is-paused .rdc-boat {
	animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
	.rdc *,
	.rdc *::before,
	.rdc *::after {
		transition: none !important;
	}
}

/* ------------------------------------------------------------ Real map (rules with TrafficData.geo, widgets/course-map)
 * The rule's SVG is a north-up grid in metres, moved onto the Leaflet map as an overlay and scaled to the map;
 * the lane block is a rotated group, the pontoons are lime rectangles, the water is the real lake. */
.rdc--map .rdc__geo {
	position: relative;
	z-index: 0;
	isolation: isolate;
	height: clamp(380px, 56cqi, 640px);
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 16px;
	background: var(--rdc-navy);
	font-family: var(--rdc-font-body);
}

.rdc--map .rdc__geo.leaflet-container {
	background: var(--rdc-navy);
}

.rdc--map .rdc__svg--v,
.rdc--map .rdc__body > .rdc__svg--h {
	display: none;
}

.rdc--map .rdc__geo-overlay {
	position: absolute;
	left: 0;
	top: 0;
	pointer-events: none;
}

.rdc--map .rdc__geo-overlay .rdc__svg--h {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	overflow: visible;
	pointer-events: none;
}

.rdc--map .rdc__geo-overlay .rdc__svg--h :is(path, g, text, circle, rect, line) {
	pointer-events: auto;
}

/* Metre grid: thin lines and small labels (units are metres; the map scales them) */
.rdc--map .rdc__geo-overlay .rdc__lanes-bg {
	fill: rgba(46, 108, 241, 0.18);
	stroke: rgba(217, 255, 3, 0.7);
	stroke-width: 1;
}

.rdc--map .rdc__geo-overlay .rdc__lane {
	stroke-width: 0.6;
	stroke-opacity: 0.75;
}

.rdc--map .rdc__geo-overlay .rdc__marker {
	stroke-width: 1;
}

.rdc--map .rdc__geo-overlay .rdc__marker.is-edge {
	stroke-width: 2;
}

.rdc--map .rdc__geo-overlay .rdc__dist {
	font-size: 11px;
}

.rdc--map .rdc__geo-overlay .rdc__lane-num {
	font-size: 8px;
}

.rdc--map .rdc__geo-overlay .rdc__dock {
	stroke: #14206c;
	stroke-width: 0.5;
}

.rdc--map .rdc__geo-overlay .rdc-arrow__line {
	stroke-width: 2.5;
}

.rdc--map .rdc__geo-overlay .rdc-arrow__hit {
	stroke-width: 10;
}

/* Editor on the real map: the SVG catches clicks only on elements, except while a tool is active */
.rvm-co__canvas--geo .rdc__geo {
	height: 70vh;
	min-height: 480px;
}

.rvm-co__canvas--geo .rdc__geo-overlay .rvm-co__svg.is-drawing {
	pointer-events: auto;
	cursor: crosshair;
}

.rvm-co__canvas--geo .co-lanes__hit {
	cursor: move;
}

.rvm-co__canvas--geo .co-lanes.is-selected .rdc__lanes-bg,
.rvm-co__canvas--geo .co-dock.is-selected {
	stroke: #fff;
	stroke-width: 2;
}

.rvm-co__canvas--geo .co-dock {
	cursor: move;
}

/* ------------------------------------------------------------ Several rules in one widget (renderPlanSet)
 * The set is the navy box with the oar wheel and a row of chips; the rules inside lose their own box. */
.rdc-set {
	--rdc-ground: #121d63;
	--rdc-lime: var(--color-secondary, #d9ff03);
	--rdc-font-body: var(--font-body, "DM Sans", sans-serif);
	container-type: inline-size;
	position: relative;
	isolation: isolate;
	overflow: hidden;
	box-sizing: border-box;
	min-width: 0;
	max-width: min(var(--container-max-width-px, 1280px), calc(100% - 2 * var(--gutter, 16px)));
	margin: clamp(24px, 4vw, 48px) auto;
	padding: clamp(20px, 4cqi, 48px);
	border-radius: 24px;
	background:
		radial-gradient(120% 80% at 80% 0%, rgba(46, 108, 241, 0.25), transparent 60%),
		var(--rdc-ground);
	color: #fff;
	font-family: var(--rdc-font-body);
}

:is(.rde-layout.rde-contained, .rde-layout.rde-space-s, .rde-layout.rde-space-m, .rde-layout.rde-space-l, .venue-public) .rdc-set {
	max-width: 100%;
	margin: 0;
}

.rdc-set .rdc-set__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 4px;
}

.rdc-set .rdc-set__tab {
	margin: 0;
	padding: 8px 16px;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 999px;
	background: transparent;
	box-shadow: none;
	color: #fff;
	font: 600 14px/1.2 var(--rdc-font-body);
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
	transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.rdc-set .rdc-set__tab:hover {
	border-color: #fff;
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
}

.rdc-set .rdc-set__tab[aria-selected="true"] {
	border-color: var(--rdc-lime);
	background: var(--rdc-lime);
	color: #14206c;
}

.rdc-set .rdc-set__tab:focus-visible {
	outline: 2px solid var(--rdc-lime);
	outline-offset: 2px;
}

.rdc-set .rdc-set__panel[hidden] {
	display: none;
}

.rdc-set .rdc {
	max-width: 100%;
	margin: 0;
	padding: 12px 0 0;
	border-radius: 0;
	background: none;
	overflow: visible;
}

.rdc-set .rdc .rdc__wheel {
	display: none;
}

/* The set's own oar wheel (same drawing as in every widget) */
.rdc-set > .rdc__wheel {
	--rdc-wheel-r: clamp(150px, 30cqi, 300px);
	--rdc-wheel-u: calc(var(--rdc-wheel-r) / 320);
	position: absolute;
	z-index: -1;
	top: 0;
	right: 0;
	width: calc(var(--rdc-wheel-u) * 351);
	height: calc(var(--rdc-wheel-u) * 348);
	max-height: 100%;
	overflow: hidden;
	border-top-right-radius: 24px;
	color: var(--rdc-wheel-color, #406ce6);
	opacity: 0.35;
	pointer-events: none;
}

.rdc-set > .rdc__wheel::before,
.rdc-set > .rdc__wheel::after {
	content: "";
	position: absolute;
	top: calc(var(--rdc-wheel-u) * -292);
	width: calc(var(--rdc-wheel-u) * 335);
	height: calc(var(--rdc-wheel-u) * 640);
	background: currentColor;
	-webkit-mask: url(/brand/oars.png) center / contain no-repeat;
	mask: url(/brand/oars.png) center / contain no-repeat;
}

.rdc-set > .rdc__wheel::before {
	left: 0;
}

.rdc-set > .rdc__wheel::after {
	left: calc(var(--rdc-wheel-u) * 307);
	transform: scaleX(-1);
}

.rdc--map .rdc__geo-hint {
	position: absolute;
	z-index: 1001;
	inset: auto 50% 16px auto;
	transform: translateX(50%);
	padding: 8px 14px;
	border-radius: 999px;
	background: rgba(20, 32, 108, 0.9);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s;
}

.rdc--map .rdc__geo-hint.is-visible {
	opacity: 1;
}

/* Zoom buttons and attribution as on the hotel map */
.rdc--map .leaflet-bar {
	border: 0;
	border-radius: 12px;
	box-shadow: 0 4px 14px rgba(10, 16, 60, 0.25);
	overflow: hidden;
}

.rdc--map .leaflet-bar a,
.rdc--map .leaflet-bar a:hover {
	width: 36px;
	height: 36px;
	border-bottom: 1px solid rgba(20, 32, 108, 0.12);
	background: #fff;
	color: var(--rdc-navy);
	font: 600 20px/36px var(--rdc-font-body);
	text-decoration: none;
}

.rdc--map .leaflet-control-attribution {
	padding: 2px 8px;
	border-top-left-radius: 8px;
	background: rgba(255, 255, 255, 0.85);
	color: var(--rdc-navy);
	font: 11px/1.4 var(--rdc-font-body);
}

.rdc--map .leaflet-control-attribution a {
	color: var(--rdc-navy);
	text-decoration: underline;
}

/* ------------------------------------------------------------ Live wind (rule option "Wind anzeigen") */
.rdc__wind {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 8px 0 14px;
	padding: 8px 12px 8px 8px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.07);
	font-size: 13px;
	color: var(--rdc-muted);
}
.rdc__wind[hidden] { display: none; }
.rdc__wind-compass { width: 48px; height: 48px; flex: 0 0 auto; }
.rdc__wind-compass svg { width: 100%; height: 100%; display: block; }
.rdc__wind-ring { fill: rgba(255, 255, 255, 0.06); stroke: rgba(255, 255, 255, 0.25); stroke-width: 1.5; }
.rdc__wind-course { fill: rgba(46, 108, 241, 0.35); stroke: rgba(255, 255, 255, 0.35); stroke-width: 1; }
.rdc__wind-finish { stroke: var(--rdc-lime); stroke-width: 2.5; }
.rdc__wind-dir { fill: none; stroke: rgba(255, 255, 255, 0.75); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rdc__wind-arrow path { fill: none; stroke: #6eebfc; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.rdc__wind--head .rdc__wind-arrow path { stroke: #ff5929; }
.rdc__wind--tail .rdc__wind-arrow path { stroke: #3ddc84; }
.rdc__wind-text { color: #fff; font-weight: 600; }

/* Drifting wind arrows over the lane block (rule option "Wind anzeigen") */
.rdc__wind-field { pointer-events: none; }
.rdc__wind-glyph { fill: none; stroke: #6eebfc; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; opacity: 0.5; vector-effect: non-scaling-stroke; }
.rdc__wind-field--head .rdc__wind-glyph { stroke: #ff5929; }
.rdc__wind-field--tail .rdc__wind-glyph { stroke: #3ddc84; }
.rdc__wind-grid { animation: rdc-windflow var(--rdc-wind-dur, 6s) linear infinite; }
@keyframes rdc-windflow {
	from { transform: translate(0, 0); }
	to { transform: translate(var(--rdc-wx, 0px), var(--rdc-wy, 0px)); }
}
@media (prefers-reduced-motion: reduce) { .rdc__wind-grid { animation: none; } }
.rdc.is-paused .rdc__wind-grid { animation-play-state: paused; }
