/* =========================================================
   Wespen game — frontend
   Huisstijl: Montserrat (koppen), Lato (bodytekst)
   ========================================================= */

.wg-root {
	--wg-primary: #219ebc;
	--wg-primary-dark: #176684;
	--wg-primary-light: #8ecae6;
	--wg-button: #fb8500;
	--wg-button-dark: #d97100;
	--wg-button-text: #ffffff;
	--wg-bg-top: #219ebc;
	--wg-bg-mid: #8ecae6;
	--wg-bg-bottom: #d8f0f8;
	--wg-form-intro: #5bc0de;
	--wg-ink: #10333f;
	--wg-panel: rgba(255, 255, 255, 0.96);
	--wg-radius: 18px;
	--wg-shadow: 0 24px 60px rgba(9, 46, 60, 0.28);
	--wg-font-head: "Montserrat", "Helvetica Neue", Arial, sans-serif;
	--wg-font-body: "Lato", "Helvetica Neue", Arial, sans-serif;

	position: relative;
	width: 100%;
	min-height: 70vh;
	overflow: hidden;
	font-family: var(--wg-font-body);
	color: var(--wg-ink);
	background: linear-gradient(180deg, var(--wg-bg-top) 0%, var(--wg-bg-mid) 62%, var(--wg-bg-bottom) 100%);
	-webkit-font-smoothing: antialiased;
	line-height: 1.55;
}

.wg-root--fullscreen {
	position: fixed;
	inset: 0;
	width: 100vw;
	width: 100dvw;
	height: 100vh;
	height: 100dvh;
	min-height: 0;
	z-index: 99990;
}

body.wg-lock {
	overflow: hidden;
}

/* Ruimte voor de WordPress adminbalk. */
body.admin-bar .wg-root--fullscreen {
	top: 32px;
	height: calc(100vh - 32px);
	height: calc(100dvh - 32px);
}

@media screen and (max-width: 782px) {
	body.admin-bar .wg-root--fullscreen {
		top: 46px;
		height: calc(100vh - 46px);
		height: calc(100dvh - 46px);
	}
}

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

/* ---------- Schermen ---------- */

.wg-screen {
	position: absolute;
	inset: 0;
	display: none;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}

.wg-screen.is-active {
	display: block;
}

.wg-screen--start,
.wg-screen--end {
	background-image:
		radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.35) 0, transparent 42%),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='96' viewBox='0 0 56 96'%3E%3Cpath d='M28 0l24 14v28L28 56 4 42V14z' fill='none' stroke='%23ffffff' stroke-opacity='.16' stroke-width='2'/%3E%3Cpath d='M0 48l24 14v28L0 104l-24-14V62z' fill='none' stroke='%23ffffff' stroke-opacity='.16' stroke-width='2'/%3E%3Cpath d='M56 48l24 14v28l-24 14-24-14V62z' fill='none' stroke='%23ffffff' stroke-opacity='.16' stroke-width='2'/%3E%3C/svg%3E");
	background-size: auto, 56px 96px;
}

.wg-screen__inner {
	position: relative;
	max-width: 620px;
	margin: 0 auto;
	min-height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	text-align: center;
	gap: 18px;
	padding: 56px 0 24px;
}

.wg-screen--end .wg-screen__inner {
	padding-top: 32px;
}

/* ---------- Typografie ---------- */

.wg-title {
	font-family: var(--wg-font-head);
	font-weight: 800;
	font-size: clamp(2rem, 6vw, 3.2rem);
	line-height: 1.05;
	letter-spacing: -0.02em;
	margin: 0;
	color: #ffffff;
	text-shadow: 0 4px 18px rgba(9, 46, 60, 0.35);
}

.wg-title--high {
	font-size: clamp(1.1rem, 3.2vw, 1.55rem);
	font-weight: 700;
	letter-spacing: 0;
	margin-bottom: -6px;
}

.wg-title--high span {
	font-weight: 800;
}

.wg-title--score span {
	display: inline-block;
	color: var(--wg-button);
	background: #fff;
	border-radius: 14px;
	padding: 0 14px;
	text-shadow: none;
}

.wg-subtitle {
	font-family: var(--wg-font-head);
	font-weight: 700;
	font-size: clamp(1.25rem, 3.4vw, 1.6rem);
	line-height: 1.2;
	margin: 0;
	color: var(--wg-ink);
}

.wg-text {
	font-size: 1.05rem;
	margin: 0;
	color: var(--wg-ink);
}

.wg-text p {
	margin: 0 0 12px;
}

.wg-text p:last-child {
	margin-bottom: 0;
}

.wg-screen--start .wg-text {
	color: #ffffff;
	max-width: 46ch;
	text-shadow: 0 2px 10px rgba(9, 46, 60, 0.28);
}

/* ---------- Beginscherm ---------- */

.wg-start__media {
	width: min(320px, 70%);
}

.wg-start__media img,
.wg-start__image {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--wg-radius);
	box-shadow: none;
}

/* ---------- Knoppen ---------- */

/* De selectors zijn bewust specifiek: themastijlen voor button[type="submit"]
   winnen anders van .wg-button en geven de verstuurknop een andere kleur. */
.wg-root button.wg-button,
.wg-root .wg-button {
	font-family: var(--wg-font-head);
	font-weight: 700;
	font-size: 1.05rem;
	line-height: 1;
	padding: 18px 34px;
	border: 0;
	border-radius: 999px;
	background: var(--wg-button);
	background-image: none;
	color: var(--wg-button-text);
	cursor: pointer;
	text-decoration: none;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: 0 10px 24px rgba(251, 133, 0, 0.4);
	transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.wg-root button.wg-button:hover,
.wg-root button.wg-button:focus-visible,
.wg-root .wg-button:hover,
.wg-root .wg-button:focus-visible {
	background: var(--wg-button-dark);
	color: var(--wg-button-text);
	transform: translateY(-2px);
}

.wg-root .wg-button:active {
	transform: translateY(0);
}

.wg-root .wg-button[disabled] {
	opacity: 0.65;
	cursor: progress;
	transform: none;
}

.wg-root button.wg-button--ghost,
.wg-root .wg-button--ghost {
	background: transparent;
	color: var(--wg-primary-dark);
	box-shadow: none;
	border: 2px solid var(--wg-primary);
	padding: 12px 24px;
}

.wg-root button.wg-button--ghost:hover,
.wg-root button.wg-button--ghost:focus-visible,
.wg-root .wg-button--ghost:hover,
.wg-root .wg-button--ghost:focus-visible {
	background: var(--wg-primary);
	color: #fff;
}

.wg-root .wg-link {
	font-family: var(--wg-font-body);
	font-size: 1rem;
	background: none;
	border: 0;
	padding: 0;
	color: var(--wg-primary-dark);
	text-decoration: underline;
	cursor: pointer;
}

.wg-root .wg-link:hover,
.wg-root .wg-link:focus-visible {
	color: var(--wg-button);
}

/* Opnieuw spelen: duidelijke omlijnde knop op de gekleurde achtergrond. */
.wg-root button.wg-link--replay,
.wg-root .wg-link--replay {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 10px;
	padding: 14px 30px;
	font-family: var(--wg-font-head);
	font-weight: 700;
	font-size: 1rem;
	line-height: 1;
	color: #ffffff;
	text-decoration: none;
	background: rgba(255, 255, 255, 0.14);
	border: 2px solid rgba(255, 255, 255, 0.9);
	border-radius: 999px;
	backdrop-filter: blur(4px);
	transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.wg-root button.wg-link--replay:hover,
.wg-root button.wg-link--replay:focus-visible,
.wg-root .wg-link--replay:hover,
.wg-root .wg-link--replay:focus-visible {
	background: #ffffff;
	color: var(--wg-primary-dark);
	transform: translateY(-2px);
}

.wg-root :focus-visible {
	outline: 3px solid #ffb703;
	outline-offset: 3px;
}

/* ---------- Deel-link ---------- */

.wg-share {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--wg-font-body);
	font-size: 0.95rem;
	font-weight: 700;
	color: #ffffff;
	background: rgba(255, 255, 255, 0.16);
	border: 1px solid rgba(255, 255, 255, 0.5);
	border-radius: 999px;
	padding: 10px 16px;
	cursor: pointer;
	backdrop-filter: blur(4px);
	transition: background-color 0.15s ease;
}

.wg-share:hover,
.wg-share:focus-visible {
	background: rgba(255, 255, 255, 0.3);
}

.wg-share svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
	flex: none;
}

/* Knoppen in de bovenhoeken van het beginscherm. */
.wg-corner {
	position: absolute;
	top: max(16px, env(safe-area-inset-top));
	z-index: 3;
	max-width: calc(50% - 14px);
	text-align: left;
	text-decoration: none;
}

.wg-corner--left {
	left: max(16px, env(safe-area-inset-left));
}

.wg-corner--right {
	right: max(16px, env(safe-area-inset-right));
}

.wg-corner__label {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wg-success .wg-share {
	color: var(--wg-primary-dark);
	background: rgba(33, 158, 188, 0.1);
	border-color: var(--wg-primary);
}

.wg-success .wg-share:hover {
	background: rgba(33, 158, 188, 0.2);
}

/* ---------- Game ---------- */

.wg-screen--game {
	padding: 0;
	overflow: hidden;
}

.wg-canvas {
	display: block;
	width: 100%;
	height: 100%;
	touch-action: none;
}

.wg-hud {
	position: absolute;
	top: max(14px, env(safe-area-inset-top));
	left: max(14px, env(safe-area-inset-left));
	right: max(14px, env(safe-area-inset-right));
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
	pointer-events: none;
	font-family: var(--wg-font-head);
	color: #fff;
	text-shadow: 0 2px 8px rgba(9, 46, 60, 0.45);
}

.wg-hud__right {
	text-align: right;
}

.wg-hud__row + .wg-hud__row {
	margin-top: 2px;
}

.wg-hud__label {
	font-family: var(--wg-font-body);
	font-size: 0.8rem;
	opacity: 0.9;
}

.wg-hud__value {
	font-weight: 800;
	font-size: 1rem;
	font-variant-numeric: tabular-nums;
}

.wg-hud__left .wg-hud__value {
	font-size: 1.6rem;
	display: block;
	line-height: 1.1;
}

.wg-sound {
	position: absolute;
	right: max(14px, env(safe-area-inset-right));
	bottom: max(14px, env(safe-area-inset-bottom));
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.5);
	background: rgba(9, 46, 60, 0.25);
	color: #fff;
	font-size: 18px;
	cursor: pointer;
	line-height: 1;
}

.wg-sound .wg-sound__off,
.wg-sound.is-muted .wg-sound__on {
	display: none;
}

.wg-sound.is-muted .wg-sound__off {
	display: inline;
}

.wg-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(9, 46, 60, 0.35);
	padding: 24px;
	text-align: center;
}

.wg-overlay[hidden] {
	display: none;
}

.wg-overlay__text {
	font-family: var(--wg-font-head);
	font-weight: 700;
	font-size: clamp(1.1rem, 3.5vw, 1.6rem);
	color: #fff;
	background: rgba(9, 46, 60, 0.4);
	border-radius: 999px;
	padding: 14px 26px;
	margin: 0;
	animation: wg-pulse 1.8s ease-in-out infinite;
}

@keyframes wg-pulse {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.04); }
}

/* ---------- Eindscherm ---------- */

.wg-screen--end .wg-screen__inner > *:not(.wg-title):not(.wg-link--replay) {
	width: 100%;
}

.wg-sheet,
.wg-screen--end [data-wg-form-wrap],
.wg-success {
	background: var(--wg-panel);
	border-radius: var(--wg-radius);
	box-shadow: var(--wg-shadow);
	padding: 26px 22px;
	text-align: left;
}

/* Beginscherm: alles binnen het witte vlak. */
.wg-sheet {
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 18px;
	padding: 34px 26px 30px;
	text-align: center;
}

.wg-sheet .wg-title {
	color: var(--wg-ink);
	text-shadow: none;
}

/* De kop in het witte vlak is de belangrijkste tekst op dat vlak. */
.wg-sheet__title {
	font-size: clamp(1.5rem, 4.6vw, 2.1rem);
	line-height: 1.1;
	letter-spacing: -0.01em;
}

.wg-screen--start .wg-sheet .wg-text {
	color: var(--wg-ink);
	text-shadow: none;
}

.wg-success {
	text-align: center;
}

.wg-success__message {
	font-family: var(--wg-font-head);
	font-weight: 800;
	font-size: 1.25rem;
	margin: 0 0 6px;
	color: var(--wg-primary-dark);
}

.wg-success__rank {
	margin: 0 0 16px;
}

.wg-screen--end .wg-subtitle,
.wg-screen--end .wg-text {
	text-align: center;
}

.wg-screen--end .wg-text {
	margin-top: 8px;
}

/* ---------- Formulier ---------- */

.wg-form {
	margin-top: 20px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

/* Kop boven de velden: een afgerond label dat om de tekst heen valt, dus
   smaller dan de velden eronder zodat het niet voor een knop wordt aangezien. */
.wg-form__intro {
	display: inline-block;
	width: auto;
	max-width: 100%;
	align-self: center;
	font-family: var(--wg-font-head);
	font-weight: 700;
	font-size: 1.05rem;
	line-height: 1.25;
	color: #ffffff;
	background: var(--wg-form-intro);
	text-align: center;
	margin: 4px 0 2px;
	padding: 10px 16px;
	border: 0;
	border-radius: 999px;
}

.wg-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.wg-label {
	font-family: var(--wg-font-head);
	font-weight: 700;
	font-size: 0.9rem;
}

.wg-input {
	font-family: var(--wg-font-body);
	font-size: 1rem;
	padding: 14px 16px;
	border: 2px solid #d4e6ee;
	border-radius: 12px;
	background: #fff;
	color: var(--wg-ink);
	width: 100%;
	-webkit-appearance: none;
	appearance: none;
}

.wg-input:focus {
	border-color: var(--wg-primary);
	outline: none;
}

.wg-input.is-invalid {
	border-color: #d64545;
}

.wg-field--check {
	flex-direction: row;
	align-items: flex-start;
	gap: 10px;
}

.wg-checkbox {
	width: 22px;
	height: 22px;
	margin: 2px 0 0;
	accent-color: var(--wg-primary);
	flex: none;
}

.wg-label--check {
	font-family: var(--wg-font-body);
	font-weight: 400;
	font-size: 0.98rem;
}

.wg-root .wg-form .wg-button {
	align-self: stretch;
	margin-top: 4px;
	width: 100%;
}

.wg-microcopy {
	font-size: 0.85rem;
	text-align: center;
	margin: 0;
	opacity: 0.75;
}

.wg-error {
	margin: 0;
	color: #b32020;
	font-size: 0.92rem;
	font-weight: 700;
}

.wg-error[hidden] {
	display: none;
}

.wg-honeypot {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---------- Voorwaarden pop-up ---------- */

.wg-modal {
	position: absolute;
	inset: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.wg-modal[hidden] {
	display: none;
}

.wg-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(9, 46, 60, 0.6);
}

.wg-modal__dialog {
	position: relative;
	background: #fff;
	border-radius: var(--wg-radius);
	box-shadow: var(--wg-shadow);
	padding: 28px 24px 24px;
	max-width: 560px;
	width: 100%;
	max-height: 82vh;
	overflow-y: auto;
	text-align: left;
}

.wg-modal__content {
	margin: 14px 0 20px;
	font-size: 0.98rem;
}

.wg-modal__close {
	position: absolute;
	top: 10px;
	right: 12px;
	width: 38px;
	height: 38px;
	border: 0;
	background: none;
	font-size: 28px;
	line-height: 1;
	color: var(--wg-ink);
	cursor: pointer;
	border-radius: 50%;
}

.wg-modal__close:hover {
	background: #f0f6f9;
}

/* ---------- Toast ---------- */

.wg-toast {
	position: absolute;
	left: 50%;
	bottom: max(20px, env(safe-area-inset-bottom));
	transform: translateX(-50%);
	z-index: 30;
	margin: 0;
	background: var(--wg-ink);
	color: #fff;
	font-size: 0.92rem;
	padding: 12px 18px;
	border-radius: 999px;
	box-shadow: var(--wg-shadow);
	max-width: calc(100% - 40px);
	text-align: center;
}

.wg-toast[hidden] {
	display: none;
}

/* ---------- Responsief ---------- */

@media (max-width: 480px) {
	.wg-screen__inner {
		padding-top: 72px;
		gap: 14px;
	}

	.wg-start__media {
		width: min(240px, 62%);
	}

	.wg-sheet {
		padding: 26px 18px 24px;
		gap: 14px;
	}

	.wg-root .wg-button {
		width: 100%;
		padding: 17px 24px;
	}

	.wg-root .wg-link--replay {
		width: 100%;
		justify-content: center;
	}

	.wg-corner {
		font-size: 0.85rem;
		padding: 9px 13px;
	}

	/* Te weinig ruimte voor twee labels: links blijft alleen het pijltje over. */
	.wg-corner--left {
		padding: 10px;
	}

	.wg-corner--left .wg-corner__label {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}

	.wg-hud__left .wg-hud__value {
		font-size: 1.35rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wg-root *,
	.wg-root *::before,
	.wg-root *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
