/* Harbor Light. Colors come from the site's Elementor globals so the buttons
   and arrival card follow the site in light and dark; the fallbacks are the
   perridm.com values for anywhere those globals are missing. */

.pdmhl {
	--pdmhl-btn: var(--e-global-color-primary, #2C5E2E);
	--pdmhl-btn-text: var(--e-global-color-on-primary, #FFFEF1);
	--pdmhl-card: var(--e-global-color-page, #FFFFFF);
	--pdmhl-text: var(--e-global-color-text, #0C273D);
	max-width: 960px;
	margin: 0 auto;
	color: var(--pdmhl-text);
}

html[data-theme="dark"] .pdmhl {
	--pdmhl-btn: var(--e-global-color-primary, #70B85D);
	--pdmhl-btn-text: var(--e-global-color-on-primary, #0C273D);
	--pdmhl-card: var(--e-global-color-page, #0C273D);
	--pdmhl-text: var(--e-global-color-text, #FFFEF1);
}

.pdmhl__stage {
	position: relative;
	aspect-ratio: 16 / 9;
	border-radius: 14px;
	overflow: hidden;
	background: #16395A;
}

.pdmhl__canvas {
	display: block;
	width: 100%;
	height: 100%;
}

.pdmhl__btn,
.pdmhl__key {
	font: inherit;
	font-weight: 700;
	border: 0;
	border-radius: 10px;
	background: var(--pdmhl-btn);
	color: var(--pdmhl-btn-text);
	cursor: pointer;
}

.pdmhl__btn {
	padding: 10px 26px;
	font-size: 18px;
}

.pdmhl__btn:focus-visible,
.pdmhl__key:focus-visible {
	outline: 3px solid var(--e-global-color-accent, #54D0ED);
	outline-offset: 2px;
}

.pdmhl__start {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.pdmhl__play {
	padding: 14px 40px;
	font-size: 22px;
	box-shadow: 0 6px 20px rgba(6, 19, 31, .35);
}

.pdmhl__end {
	position: absolute;
	top: 12%;
	left: 6%;
	max-width: min(440px, 70%);
	padding: 20px 24px;
	border-radius: 14px;
	background: color-mix(in srgb, var(--pdmhl-card) 94%, transparent);
	box-shadow: 0 6px 20px rgba(6, 19, 31, .25);
}

.pdmhl__end[hidden],
.pdmhl__start[hidden] {
	display: none;
}

.pdmhl__end-title {
	margin: 0 0 4px;
	font-size: 28px;
	font-weight: 700;
	line-height: 1.15;
}

.pdmhl__end-text {
	margin: 0 0 14px;
	font-size: 18px;
	line-height: 1.35;
}

.pdmhl__live {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
}

/* Arrow pad: an upside-down T. Holding a button keeps it acting, so the
   buttons swallow the touch gestures that would otherwise scroll or zoom. */
.pdmhl__pad {
	display: grid;
	grid-template-columns: repeat(3, 60px);
	grid-template-rows: repeat(2, 52px);
	gap: 8px;
	justify-content: center;
	margin-top: 16px;
}

.pdmhl__key {
	font-size: 22px;
	line-height: 1;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
	transition: transform .08s, opacity .2s;
}

.pdmhl__key svg {
	display: block;
	width: 20px;
	height: 20px;
	margin: auto;
}

.pdmhl__key--up    { grid-column: 2; grid-row: 1; }
.pdmhl__key--left  { grid-column: 1; grid-row: 2; }
.pdmhl__key--down  { grid-column: 2; grid-row: 2; }
.pdmhl__key--right { grid-column: 3; grid-row: 2; }

.pdmhl__key.is-held {
	transform: scale(.92);
}

.pdmhl:not([data-state="playing"]) .pdmhl__key {
	opacity: .45;
	cursor: default;
}

.pdmhl__help {
	margin: 12px 0 0;
	text-align: center;
	font-size: 14px;
	opacity: .7;
}

@media (max-width: 560px) {
	.pdmhl__pad {
		grid-template-columns: repeat(3, 68px);
		grid-template-rows: repeat(2, 60px);
	}

	.pdmhl__end {
		top: 6%;
		left: 4%;
		max-width: 80%;
		padding: 12px 14px;
	}

	.pdmhl__end-title { font-size: 20px; }
	.pdmhl__end-text  { font-size: 15px; margin-bottom: 10px; }
	.pdmhl__btn       { font-size: 16px; padding: 8px 18px; }
	.pdmhl__play      { font-size: 20px; padding: 12px 32px; }
}

@media (prefers-reduced-motion: reduce) {
	.pdmhl__key { transition: none; }
}
