/* BDE Chasse au trésor — isolé du thème WordPress */

.bde-th,
.bde-th-panel,
.bde-th-launcher,
.bde-th-spot {
	--bde-th-brown: #593222;
	--bde-th-beige: #f5e5c0;
	--bde-th-orange: #f2882f;
	--bde-th-green: #6d9244;
	--bde-th-olive: #6e6f33;
}

.bde-th,
.bde-th-panel,
.bde-th-launcher {
	font-family: "Chau Philomene One", sans-serif;
}

.bde-th:not([hidden]) {
	display: block;
}

/* Reset thème sur tous les boutons du plugin */
button.bde-th-spot,
button.bde-th-launcher,
button.bde-th-panel__toggle,
button.bde-th-panel__hint-btn,
button.bde-th-popup__btn,
#bde-th-spot,
#bde-th-launcher,
#bde-th-panel-toggle,
#bde-th-hint-btn,
#bde-th-popup-close {
	appearance: none !important;
	-webkit-appearance: none !important;
	text-decoration: none !important;
	box-sizing: border-box !important;
}

body button.bde-th-spot:hover,
body button.bde-th-spot:focus,
body button.bde-th-spot:focus-visible,
body button.bde-th-spot:active,
body button.bde-th-spot:focus-within,
body #bde-th-spot:hover,
body #bde-th-spot:focus,
body #bde-th-spot:focus-visible,
body #bde-th-spot:active,
body .bde-th-spot:hover,
body .bde-th-spot:focus,
body .bde-th-spot:active {
	background: transparent !important;
	background-color: transparent !important;
	border: none !important;
	border-color: transparent !important;
	box-shadow: none !important;
	color: inherit !important;
	text-decoration: none !important;
	outline-color: var(--bde-th-orange) !important;
}

button.bde-th-launcher,
button.bde-th-launcher:hover,
button.bde-th-launcher:focus,
button.bde-th-launcher:focus-visible,
button.bde-th-launcher:active,
#bde-th-launcher:hover,
#bde-th-launcher:focus,
#bde-th-launcher:focus-visible,
#bde-th-launcher:active {
	background: var(--bde-th-beige) !important;
	background-color: var(--bde-th-beige) !important;
	color: var(--bde-th-brown) !important;
	border: 2px solid rgba(89, 50, 34, 0.22) !important;
	text-decoration: none !important;
}

button.bde-th-panel__toggle,
button.bde-th-panel__toggle:hover,
button.bde-th-panel__toggle:focus,
button.bde-th-panel__toggle:active,
#bde-th-panel-toggle:hover,
#bde-th-panel-toggle:focus,
#bde-th-panel-toggle:active {
	background: #fff8eb !important;
	background-color: #fff8eb !important;
	color: var(--bde-th-brown) !important;
	border: 1px solid rgba(89, 50, 34, 0.2) !important;
}

button.bde-th-panel__hint-btn,
button.bde-th-panel__hint-btn:hover,
button.bde-th-panel__hint-btn:focus,
button.bde-th-panel__hint-btn:focus-visible,
button.bde-th-panel__hint-btn:active,
#bde-th-hint-btn,
#bde-th-hint-btn:hover,
#bde-th-hint-btn:focus,
#bde-th-hint-btn:focus-visible,
#bde-th-hint-btn:active {
	background: var(--bde-th-orange) !important;
	background-color: var(--bde-th-orange) !important;
	color: var(--bde-th-brown) !important;
	border: 1px solid var(--bde-th-olive) !important;
	text-decoration: none !important;
}

button.bde-th-popup__btn,
button.bde-th-popup__btn:hover,
button.bde-th-popup__btn:focus,
button.bde-th-popup__btn:active,
#bde-th-popup-close:hover,
#bde-th-popup-close:focus,
#bde-th-popup-close:active {
	background: var(--bde-th-orange) !important;
	background-color: var(--bde-th-orange) !important;
	color: var(--bde-th-brown) !important;
	border: 2px solid var(--bde-th-olive) !important;
}

/* Menu chasseurs */
.bde-th-launcher {
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	z-index: 100050;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.4rem 0.7rem;
	border: 2px solid rgba(89, 50, 34, 0.22);
	border-radius: 9999px;
	background: var(--bde-th-beige);
	color: var(--bde-th-brown);
	font-family: "Special Elite", monospace;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(89, 50, 34, 0.2);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button.bde-th-launcher:hover,
button.bde-th-launcher:focus-visible {
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(242, 136, 47, 0.28) !important;
	outline: none !important;
}

/* Coffre cliquable — petit, sans fond au survol */
button.bde-th-spot,
#bde-th-spot {
	position: fixed;
	right: 1rem;
	bottom: 3.15rem;
	z-index: 100040;
	padding: 0 !important;
	margin: 0 !important;
	min-width: 0 !important;
	min-height: 0 !important;
	width: auto !important;
	height: auto !important;
	border: none !important;
	border-radius: 0 !important;
	background: transparent !important;
	cursor: pointer;
	line-height: 0;
	-webkit-tap-highlight-color: transparent;
	filter: drop-shadow(0 3px 8px rgba(45, 28, 18, 0.28));
	transition: transform 0.2s ease, filter 0.2s ease;
	animation: bde-th-spot-float 3s ease-in-out infinite;
}

button.bde-th-spot:not([hidden]),
#bde-th-spot:not([hidden]) {
	display: block;
}

.bde-th-chest-art {
	display: block;
	width: 2.65rem;
	height: auto;
	pointer-events: none;
	user-select: none;
}

button.bde-th-spot:hover,
button.bde-th-spot:focus-visible,
#bde-th-spot:hover,
#bde-th-spot:focus-visible {
	transform: scale(1.05) translateY(-2px);
	filter: drop-shadow(0 5px 12px rgba(242, 136, 47, 0.35));
	animation: none;
	outline: none !important;
}

button.bde-th-spot:focus-visible,
#bde-th-spot:focus-visible {
	outline: 2px solid var(--bde-th-orange) !important;
	outline-offset: 4px !important;
	box-shadow: none !important;
}

@keyframes bde-th-spot-float {
	0%,
	100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-3px);
	}
}

/* Coffre 5 — icône disclaimer clignotante (page Journée type / journee-type.html) */
.journee-type-wrapper .disclaimer-header__icon.bde-th-disclaimer-blink,
.disclaimer-header__icon.bde-th-disclaimer-blink,
[data-bde-th-disclaimer-trigger].bde-th-disclaimer-blink {
	cursor: pointer !important;
	animation: bde-th-disclaimer-blink 1.1s ease-in-out infinite;
	border-radius: 50%;
	outline: none;
}

.journee-type-wrapper .disclaimer-header__icon.bde-th-disclaimer-blink:focus-visible,
.disclaimer-header__icon.bde-th-disclaimer-blink:focus-visible,
[data-bde-th-disclaimer-trigger].bde-th-disclaimer-blink:focus-visible {
	outline: 2px solid var(--bde-th-orange) !important;
	outline-offset: 3px;
}

@keyframes bde-th-disclaimer-blink {
	0%,
	100% {
		opacity: 1;
		transform: scale(1);
		filter: drop-shadow(0 0 0 rgba(242, 136, 47, 0));
	}
	50% {
		opacity: 0.55;
		transform: scale(1.12);
		filter: drop-shadow(0 0 10px rgba(242, 136, 47, 0.75));
	}
}

/* Coffre 6 — repère carte campus (K-Fêt) */
.bde-carte-hotspot.bde-th-map-spot-blink,
.bde-carte-list__btn.bde-th-map-spot-blink {
	animation: bde-th-disclaimer-blink 1.1s ease-in-out infinite;
	outline: 2px solid rgba(242, 136, 47, 0.85);
	outline-offset: 2px;
}

button.bde-th-spot.is-anchored-edt,
#bde-th-spot.is-anchored-edt {
	z-index: 100041 !important;
	filter: drop-shadow(0 4px 14px rgba(242, 136, 47, 0.55));
}

/* Coffre 3 — ancré près des réseaux sociaux (footer) */
button.bde-th-spot.is-anchored,
#bde-th-spot.is-anchored {
	right: auto !important;
	bottom: auto !important;
	animation: bde-th-spot-float 3s ease-in-out infinite !important;
}

/* Coffre 2 — poursuite à la souris */
button.bde-th-spot.is-chase-mode,
#bde-th-spot.is-chase-mode {
	right: auto !important;
	bottom: auto !important;
	animation: none !important;
	transition: none;
}

button.bde-th-spot.is-chase-wait,
#bde-th-spot.is-chase-wait {
	cursor: default !important;
	filter: drop-shadow(0 3px 10px rgba(242, 136, 47, 0.35));
}

button.bde-th-spot.is-chase-wait .bde-th-chest-art {
	animation: bde-th-chest-hint 1.8s ease-in-out infinite;
}

@keyframes bde-th-chest-hint {
	0%,
	100% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.06);
	}
}

button.bde-th-spot.is-chase-dashing,
#bde-th-spot.is-chase-dashing {
	cursor: grab !important;
	filter: drop-shadow(0 6px 16px rgba(242, 136, 47, 0.55));
}

button.bde-th-spot.is-chase-dashing .bde-th-chest-art {
	animation: bde-th-chest-dash 0.45s ease-in-out infinite;
}

@keyframes bde-th-chest-dash {
	0%,
	100% {
		transform: rotate(-3deg) scale(1);
	}
	50% {
		transform: rotate(4deg) scale(1.04);
	}
}

button.bde-th-spot.is-chase-running,
#bde-th-spot.is-chase-running {
	cursor: crosshair !important;
	filter: drop-shadow(0 5px 14px rgba(242, 136, 47, 0.5));
}

button.bde-th-spot.is-chase-running .bde-th-chest-art {
	animation: none;
	transform: none;
}

button.bde-th-spot.is-chase-paused,
#bde-th-spot.is-chase-paused {
	cursor: not-allowed !important;
	filter: drop-shadow(0 2px 6px rgba(89, 50, 34, 0.25));
	opacity: 0.92;
}

button.bde-th-spot.is-chase-paused .bde-th-chest-art {
	filter: grayscale(0.25);
}

button.bde-th-spot.is-ready.is-chase-mode,
#bde-th-spot.is-ready.is-chase-mode {
	animation: bde-th-spot-float 3s ease-in-out infinite !important;
}

/* Coffre 4 — planche à déplacer */
.bde-th-plank-scene:not([hidden]) {
	display: block;
	position: fixed;
	left: 50%;
	bottom: 5.5rem;
	z-index: 100042;
	transform: translateX(-50%);
	width: min(20rem, calc(100vw - 2rem));
	height: 7.5rem;
	pointer-events: none;
}

.bde-th-plank-scene__stage {
	position: absolute;
	left: 50%;
	bottom: 0.35rem;
	transform: translateX(-50%);
	width: 3.25rem;
	height: 3.25rem;
	pointer-events: none;
	z-index: 1;
}

.bde-th-plank-scene__stage .bde-th-spot,
.bde-th-plank-scene__stage #bde-th-spot {
	position: absolute !important;
	left: 50% !important;
	top: 50% !important;
	right: auto !important;
	bottom: auto !important;
	transform: translate(-50%, -50%) !important;
	pointer-events: none;
	opacity: 0.35;
	filter: grayscale(0.4) drop-shadow(0 2px 6px rgba(45, 28, 18, 0.2));
	animation: none !important;
}

.bde-th-plank-scene__stage .bde-th-spot.is-plank-revealed,
.bde-th-plank-scene__stage #bde-th-spot.is-plank-revealed {
	opacity: 1;
	filter: drop-shadow(0 4px 12px rgba(242, 136, 47, 0.45));
	pointer-events: auto;
	cursor: pointer !important;
	animation: bde-th-spot-float 2.5s ease-in-out infinite !important;
}

.bde-th-plank {
	position: absolute;
	left: 50%;
	bottom: 0;
	transform: translateX(-50%);
	width: min(18rem, calc(100vw - 3rem));
	height: 4.25rem;
	z-index: 2;
	pointer-events: auto;
	cursor: grab;
	touch-action: none;
	border-radius: 4px;
	background: linear-gradient(
		165deg,
		#c9a66b 0%,
		#a67c3d 28%,
		#8b5e2a 55%,
		#6f4a22 100%
	);
	box-shadow:
		inset 0 2px 0 rgba(255, 235, 200, 0.35),
		inset 0 -3px 6px rgba(50, 30, 12, 0.25),
		0 8px 20px rgba(45, 28, 18, 0.35);
	border: 2px solid #5c3d1e;
}

.bde-th-plank:not([hidden]) {
	display: block;
}

.bde-th-plank:active {
	cursor: grabbing;
}

.bde-th-plank.is-moved-away {
	opacity: 0.92;
	box-shadow: 0 4px 12px rgba(45, 28, 18, 0.2);
}

.bde-th-plank__grain {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: inherit;
	background: repeating-linear-gradient(
		92deg,
		transparent 0,
		transparent 14px,
		rgba(70, 42, 18, 0.08) 14px,
		rgba(70, 42, 18, 0.08) 16px
	);
	pointer-events: none;
}

.bde-th-plank::after {
	content: '';
	position: absolute;
	inset: 0.45rem 0.75rem;
	border-radius: 2px;
	border: 1px dashed rgba(89, 50, 34, 0.2);
	pointer-events: none;
}

.bde-th-chase-progress {
	position: fixed;
	left: 50%;
	bottom: 5.5rem;
	z-index: 100045;
	transform: translateX(-50%);
	width: min(16rem, calc(100vw - 2rem));
	pointer-events: none;
}

.bde-th-chase-progress:not([hidden]) {
	display: block;
}

.bde-th-chase-progress__track {
	height: 6px;
	border-radius: 999px;
	background: rgba(89, 50, 34, 0.12);
	border: 1px solid rgba(89, 50, 34, 0.15);
	overflow: hidden;
}

.bde-th-chase-progress__bar {
	display: block;
	height: 100%;
	width: 0%;
	border-radius: inherit;
	background: linear-gradient(90deg, var(--bde-th-orange), var(--bde-th-green));
	transition: width 0.12s linear;
}

/* Panneau chasseurs */
.bde-th-panel {
	position: fixed;
	left: 1rem;
	bottom: 1rem;
	z-index: 100050;
	width: min(18rem, calc(100vw - 2rem));
	max-height: min(22rem, 50vh);
	background: var(--bde-th-beige);
	border: 2px solid rgba(89, 50, 34, 0.18);
	border-radius: 12px;
	box-shadow: 0 12px 32px rgba(89, 50, 34, 0.22);
	color: var(--bde-th-brown);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.bde-th-panel.is-collapsed .bde-th-panel__body {
	display: none;
}

.bde-th-panel.is-collapsed {
	max-height: none;
}

.bde-th-panel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.65rem 0.75rem;
	background: rgba(109, 146, 68, 0.12);
	border-bottom: 1px dashed rgba(89, 50, 34, 0.15);
}

.bde-th-panel__actions {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	flex-shrink: 0;
}

.bde-th-panel__hint-btn {
	padding: 0.28rem 0.45rem;
	border-radius: 6px;
	font-size: 0.62rem;
	font-family: "Special Elite", monospace;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	cursor: pointer;
	line-height: 1.2;
	white-space: nowrap;
	font-weight: 700;
}

button.bde-th-panel__hint-btn:hover,
button.bde-th-panel__hint-btn:focus-visible,
#bde-th-hint-btn:hover,
#bde-th-hint-btn:focus-visible {
	background: #d96f1f !important;
	background-color: #d96f1f !important;
	color: #fff8eb !important;
	outline: 2px solid var(--bde-th-brown) !important;
	outline-offset: 1px;
}

.bde-th-launcher[hidden],
.bde-th-panel[hidden],
.bde-th-panel__body[hidden],
.bde-th-panel__toggle[hidden],
.bde-th-panel__section--completed[hidden],
#wp-admin-bar-bde-treasure-hunt[hidden] {
	display: none !important;
}

.bde-th-panel__title {
	margin: 0;
	font-family: "Special Elite", monospace;
	font-size: 0.95rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.bde-th-panel__toggle {
	flex-shrink: 0;
	width: 1.75rem;
	height: 1.75rem;
	padding: 0;
	border: 1px solid rgba(89, 50, 34, 0.2);
	border-radius: 6px;
	background: #fff8eb;
	color: var(--bde-th-brown);
	cursor: pointer;
	font-size: 1rem;
	line-height: 1;
}

.bde-th-panel__body {
	overflow-y: auto;
	padding: 0.5rem 0.75rem 0.75rem;
}

.bde-th-panel__section + .bde-th-panel__section {
	margin-top: 0.65rem;
	padding-top: 0.65rem;
	border-top: 1px dashed rgba(89, 50, 34, 0.12);
}

.bde-th-panel__section-title {
	margin: 0 0 0.35rem;
	font-size: 0.7rem;
	font-family: "Special Elite", monospace;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--bde-th-green);
}

.bde-th-panel__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bde-th-panel__list li {
	padding: 0.35rem 0;
	font-size: 0.85rem;
	line-height: 1.35;
	display: flex;
	justify-content: space-between;
	gap: 0.5rem;
	align-items: baseline;
}

.bde-th-panel__list li.is-empty {
	justify-content: center;
	font-style: italic;
	opacity: 0.65;
	font-size: 0.8rem;
}

.bde-th-panel__name {
	font-weight: 700;
}

.bde-th-panel__progress {
	font-size: 0.75rem;
	opacity: 0.85;
	white-space: nowrap;
}

/* Popup */
.bde-th-popup {
	position: fixed;
	inset: 0;
	z-index: 100060;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.25rem;
	background: rgba(27, 42, 20, 0.55);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.28s ease, visibility 0.28s ease;
	cursor: default;
}

.bde-th-popup.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	cursor: default;
}

.bde-th-popup:not([hidden]).is-open {
	display: flex;
}

.bde-th-popup__card {
	max-width: 440px;
	width: 100%;
	padding: 1.75rem 1.5rem 1.5rem;
	background: var(--bde-th-beige);
	border: 2px solid rgba(89, 50, 34, 0.15);
	border-radius: 12px;
	box-shadow: 0 20px 40px rgba(89, 50, 34, 0.25);
	text-align: center;
	color: var(--bde-th-brown);
}

.bde-th-popup__title {
	margin: 0 0 0.75rem;
	font-family: "Special Elite", monospace;
	font-size: 1.4rem;
	font-weight: 700;
}

.bde-th-popup__body {
	margin: 0 0 1rem;
	font-size: 1.05rem;
	line-height: 1.65;
	text-align: left;
}

/* Réseaux sociaux (popup coffre 2 — mêmes icônes que le footer) */
.bde-th-popup__socials {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 1.25rem;
	width: 100%;
	margin: 1rem 0 0.25rem;
	padding: 0.75rem 0 0;
}

.bde-th-popup__socials .bde-footer__social,
.bde-th-popup .bde-footer__social {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	color: var(--bde-th-brown) !important;
	text-decoration: none !important;
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	transition: transform 0.25s ease;
}

.bde-th-popup__socials .bde-footer__social:hover,
.bde-th-popup__socials .bde-footer__social:focus-visible,
.bde-th-popup .bde-footer__social:hover,
.bde-th-popup .bde-footer__social:focus-visible {
	transform: scale(1.1);
	color: var(--bde-th-orange) !important;
	background: transparent !important;
}

.bde-th-popup__socials .bde-footer__social svg {
	display: block;
}

.bde-th-popup__socials .bde-footer__social--instagram svg,
.bde-th-popup__socials .bde-footer__social--discord svg {
	width: 32px;
	height: 32px;
}

.bde-th-popup__socials .bde-footer__social--youtube svg {
	width: 36px;
	height: 36px;
}

.bde-th-popup__hint {
	margin: 0 0 0.75rem;
	padding: 0.65rem 0.75rem;
	background: rgba(242, 136, 47, 0.12);
	border: 1px dashed rgba(242, 136, 47, 0.4);
	border-radius: 8px;
	font-size: 0.9rem;
	font-style: italic;
	text-align: left;
}

.bde-th-popup__hint:empty,
.bde-th-popup__hint.is-hidden {
	display: none;
}

.bde-th-popup__warning.is-hidden {
	display: none;
}

.bde-th-popup__warning {
	margin: 0 0 1.25rem;
	padding: 0.65rem 0.75rem;
	background: rgba(89, 50, 34, 0.06);
	border-left: 3px solid var(--bde-th-orange);
	font-size: 0.85rem;
	line-height: 1.5;
	text-align: left;
}

.bde-th-popup__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.65rem 1.35rem;
	border: 2px solid var(--bde-th-olive);
	border-radius: 9999px;
	background: var(--bde-th-orange);
	color: var(--bde-th-brown);
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 700;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button.bde-th-popup__btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(242, 136, 47, 0.35) !important;
}

@media (max-width: 640px) {
	button.bde-th-spot,
	#bde-th-spot {
		right: 0.5rem;
		bottom: 2.85rem;
	}

	.bde-th-chest-art {
		width: 2.25rem;
	}

	.bde-th-panel {
		left: 0.5rem;
		bottom: 0.5rem;
		width: calc(100vw - 1rem);
		max-width: calc(100vw - 1rem);
	}

	.bde-th-launcher {
		right: 0.5rem;
		bottom: 0.5rem;
		font-size: 0.72rem;
		padding: 0.45rem 0.7rem;
	}
}
