/* =============================================================================
   Jeu d'Halloween — « Des bonbons ou un sort ? »
   D'après la maquette Claude Design. Les jetons de la charte sont redéclarés
   ici, sur la racine du jeu : le décor de la maquette s'en sert partout.
   Les états (phase de la porte, grande nuit, largeur) sont des classes et
   attributs posés par halloween.js sur .tij-halloween.
   ============================================================================= */

.tij-halloween {
	--ti-plum-900: #1F1230;
	--ti-plum-800: #2D1B47;
	--ti-plum-700: #4A2F70;
	--ti-plum-600: #66448F;
	--ti-plum-500: #8662B0;
	--ti-plum-400: #A684CC;
	--ti-plum-300: #C897EA;
	--ti-plum-200: #DDB8F0;
	--ti-plum-100: #EEDDF8;
	--ti-plum-50: #F7EEFC;
	--ti-cherry-700: #C84372;
	--ti-cherry-500: #FF6FA5;
	--ti-cherry-400: #FF8FBB;
	--ti-cherry-300: #FFB3D0;
	--ti-cherry-200: #FFD3E2;
	--ti-peach-600: #F49680;
	--ti-peach-500: #FEC6B8;
	--ti-banana-600: #E8BC4A;
	--ti-banana-500: #FFDD81;
	--ti-banana-400: #FFE7A2;
	--ti-banana-300: #FFEFBF;
	--ti-banana-100: #FFFBEC;
	--ti-mint-600: #6BC9A6;
	--ti-mint-400: #B8E5D4;
	--ti-cream: #F8F7F1;
	--ti-white: #FFFFFF;
	--ti-ink: #2D1B47;
	--ti-mauve-500: #6B5B82;
	--font-display: "Caveat Brush", "Comic Sans MS", cursive;
	--font-body: inherit;
	--sh-1: 0 1px 2px rgba(45, 27, 71, 0.05);
	--sh-2: 0 2px 8px rgba(45, 27, 71, 0.06), 0 1px 2px rgba(45, 27, 71, 0.04);
	--sh-3: 0 8px 24px rgba(45, 27, 71, 0.08), 0 2px 4px rgba(45, 27, 71, 0.04);
	--ressort: cubic-bezier(0.34, 1.56, 0.64, 1);
	--sortie: cubic-bezier(0.16, 1, 0.3, 1);
	--focus: 0 0 0 4px rgba(255, 111, 165, 0.32);
	position: relative;
	color: var(--ti-ink);
	line-height: 1.5;
}

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

.tij-halloween .tia-lucide {
	display: inline-block;
}

.tij-halloween .tia-icone {
	display: inline-block;
	width: 1em;
	height: 1em;
	vertical-align: -0.125em;
}

/* Grande nuit ou non : deux décors, un seul visible. */
.tij-halloween:not(.is-grande) .tij-seul-grande,
.tij-halloween.is-grande .tij-seul-normal {
	display: none !important;
}

/* Boutons : Divi et le thème ne s'en mêlent pas. */
.tij-halloween button {
	margin: 0;
	font-family: inherit;
	text-transform: none;
	letter-spacing: normal;
	-webkit-appearance: none;
	appearance: none;
}

.tij-halloween button:focus-visible,
.tij-halloween a:focus-visible,
.tij-halloween [role="slider"]:focus-visible {
	outline: none;
	box-shadow: var(--focus);
}

/* =============================================================================
   Le caveau
   ============================================================================= */

.tij-caveau {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	overflow: hidden;
	background: var(--ti-plum-900);
	color: var(--ti-white);
}

.tij-etoile {
	position: absolute;
	border-radius: 999px;
}

.tij-lune {
	position: absolute;
	top: clamp(18px, 3vw, 34px);
	right: clamp(18px, 7vw, 110px);
	width: clamp(52px, 7vw, 80px);
	height: clamp(52px, 7vw, 80px);
	border-radius: 999px;
	box-shadow: inset clamp(-24px, -2vw, -14px) clamp(-8px, -0.6vw, -4px) 0 0 var(--ti-banana-500);
	transform: rotate(-18deg);
	filter: drop-shadow(0 0 22px rgba(255, 221, 129, 0.45));
}

.tij-lune-pleine {
	position: absolute;
	top: clamp(4px, 1.5vw, 18px);
	right: clamp(4px, 5.5vw, 90px);
	width: clamp(84px, 10vw, 120px);
	height: clamp(84px, 10vw, 120px);
	border-radius: 999px;
	background: var(--ti-banana-400);
	box-shadow: 0 0 40px 12px rgba(255, 221, 129, 0.45), 0 0 140px 50px rgba(255, 221, 129, 0.18), inset -10px -8px 0 rgba(229, 178, 60, 0.35);
}

.tij-lune-pleine > span {
	position: absolute;
	border-radius: 999px;
	background: rgba(229, 178, 60, 0.35);
}

.tij-lune-pleine > span:first-child {
	left: 26%;
	top: 30%;
	width: 16%;
	height: 16%;
}

.tij-lune-pleine > span:last-child {
	left: 55%;
	top: 55%;
	width: 11%;
	height: 11%;
	background: rgba(229, 178, 60, 0.3);
}

.tij-eclair-flash {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: var(--ti-plum-100);
	opacity: 0;
	pointer-events: none;
}

.tij-eclair {
	position: absolute;
	top: 0;
	left: 20%;
	z-index: 1;
	width: 70px;
	height: 46%;
	background: var(--ti-banana-100);
	clip-path: polygon(55% 0, 70% 0, 52% 34%, 72% 34%, 34% 72%, 50% 40%, 30% 40%);
	opacity: 0;
	pointer-events: none;
	filter: drop-shadow(0 0 18px var(--ti-plum-100));
}

.tij-sorciere {
	position: absolute;
	top: clamp(28px, 5vw, 56px);
	left: 0;
	z-index: 1;
	width: 84px;
	height: 52px;
	opacity: 0;
	pointer-events: none;
}

.tij-sorciere svg {
	display: block;
	overflow: visible;
}

/* Bouton du son */
.tij-halloween button.tij-son {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 6;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 44px;
	min-width: 44px;
	padding: 0 16px 0 12px;
	border: 1px solid var(--ti-plum-400);
	border-radius: 999px;
	background: var(--ti-plum-800);
	color: var(--ti-plum-100);
	font-size: 20px;
	cursor: pointer;
	transition: transform 140ms var(--ressort);
}

.tij-halloween button.tij-son:hover {
	transform: translateY(-2px);
}

.tij-son__off,
.tij-son__on {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.tij-son__texte {
	font-size: 14px;
	font-weight: 700;
	white-space: nowrap;
}

.tij-son__on,
.tij-son[aria-pressed="true"] .tij-son__off {
	display: none;
}

.tij-halloween button.tij-son[aria-pressed="true"] {
	padding: 0;
	border-color: var(--ti-plum-600);
	color: var(--ti-plum-200);
}

.tij-son[aria-pressed="true"] .tij-son__on {
	display: inline-flex;
}

/* En-tête */
.tij-entete {
	position: relative;
	z-index: 3;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	max-width: 640px;
	padding: clamp(84px, 10vw, 96px) 20px 0;
	text-align: center;
}

.tij-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 16px 7px 12px;
	border-radius: 999px;
	background: var(--ti-banana-500);
	box-shadow: 0 0 28px rgba(255, 221, 129, 0.45);
	color: var(--ti-ink);
	font-size: 14px;
	font-weight: 700;
}

.tij-badge .tia-lucide,
.tij-badge .tia-icone {
	font-size: 18px;
}

.tij-halloween p.tij-surtitre {
	margin: 0;
	padding: 0;
	color: var(--ti-plum-200);
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.tij-halloween h2.tij-titre {
	margin: 0;
	padding: 0;
	color: var(--ti-cream);
	font-family: var(--font-display);
	font-size: clamp(46px, 8vw, 88px);
	font-weight: 400;
	line-height: 0.95;
	text-wrap: balance;
}

.tij-halloween h2.tij-titre span {
	color: var(--ti-cherry-400);
}

.tij-halloween p.tij-intro {
	margin: 0;
	padding: 0;
	color: var(--ti-plum-100);
	font-size: clamp(15.5px, 1.8vw, 18px);
	line-height: 1.55;
	text-wrap: pretty;
}

/* =============================================================================
   La scène
   ============================================================================= */

.tij-jeu {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	width: 100%;
	margin-top: clamp(12px, 3vw, 28px);
}

.tij-scene {
	position: relative;
	z-index: 2;
	width: 100%;
	height: 492px;
	overflow-x: clip;
	overflow-y: visible;
}

.tij-halo {
	position: absolute;
	right: -10%;
	bottom: 70px;
	left: -10%;
	height: 150px;
	border-radius: 50%;
	background: var(--ti-plum-700);
	opacity: 0.35;
	filter: blur(40px);
}

.tij-plan {
	position: absolute;
	inset: 0;
}

.tij-plan--proche {
	z-index: 4;
	pointer-events: none;
}

.tij-brume {
	position: absolute;
	border-radius: 999px;
}

.tij-brume--a {
	bottom: 110px;
	left: -10%;
	width: 80%;
	height: 70px;
	background: var(--ti-plum-300);
	opacity: 0.14;
	filter: blur(22px);
}

.tij-brume--b {
	right: -8%;
	bottom: 26px;
	z-index: 2;
	width: 80%;
	height: 54px;
	background: var(--ti-plum-200);
	opacity: 0.11;
	filter: blur(18px);
}

.tij-sol {
	position: absolute;
	right: -5%;
	bottom: 0;
	left: -5%;
	z-index: 2;
	height: 44px;
	border-radius: 50% 50% 0 0 / 22px 22px 0 0;
	background: var(--ti-plum-900);
}

.tij-arbre {
	position: absolute;
	bottom: 60px;
	left: 144px;
	width: 240px;
	height: 360px;
}

.tij-arbre svg {
	position: absolute;
	inset: 0;
	display: block;
	overflow: visible;
}

.tij-hibou {
	position: absolute;
	left: 170px;
	top: 92px;
	width: 36px;
	height: 46px;
}

.tij-hibou__corps {
	position: absolute;
	inset: 0;
}

.tij-hibou__yeux {
	position: absolute;
	left: 4px;
	top: 10px;
	display: flex;
	justify-content: space-between;
	width: 28px;
	height: 12px;
	transform-origin: center;
}

.tij-hibou__yeux > span {
	display: grid;
	place-items: center;
	width: 12px;
	height: 12px;
	border-radius: 999px;
	background: var(--ti-banana-500);
	box-shadow: 0 0 8px rgba(255, 221, 129, 0.6);
}

.tij-hibou__yeux > span > span {
	width: 5px;
	height: 5px;
	border-radius: 999px;
	background: var(--ti-plum-900);
}

/* Citrouilles devant les tombes des bords, seulement quand le caveau prend
   presque toute la largeur (celles du décor sont alors masquées). */
.tij-pk--mobile {
	display: none;
}

@media (max-width: 819px) {
	.tij-pk--mobile {
		display: block;
	}
}

.tij-pk.is-cache {
	display: none;
}

/* Bulle d'un fantôme */
.tij-bulle {
	position: absolute;
	bottom: calc(100% + 12px);
	left: 50%;
	width: max-content;
	max-width: 190px;
	padding: 8px 12px 9px;
	border-radius: 16px;
	background: var(--ti-white);
	box-shadow: var(--sh-2);
	color: var(--ti-ink);
	font-family: var(--font-display);
	font-size: 19px;
	line-height: 1.1;
	text-align: center;
	opacity: 0;
	transform: translateX(-50%);
	pointer-events: none;
}

.tij-bulle__queue {
	position: absolute;
	bottom: -5px;
	left: 50%;
	width: 12px;
	height: 12px;
	margin-left: -6px;
	border-radius: 2px;
	background: var(--ti-white);
	transform: rotate(45deg);
}

.tij-ombre {
	position: absolute;
	bottom: 0;
	left: 50%;
	z-index: 3;
	width: min(520px, 96%);
	height: 34px;
	margin-left: min(-260px, -48%);
	border-radius: 50%;
	background: var(--ti-plum-900);
	opacity: 0;
	filter: blur(6px);
	transform-origin: center bottom;
	pointer-events: none;
}

/* Le caveau (dessiné à 440 × 452, mis à l'échelle par le script) */
.tij-crypte {
	position: absolute;
	bottom: 12px;
	left: 50%;
	z-index: 3;
	width: 440px;
	height: 452px;
	margin-left: -220px;
}

.tij-crypte__echelle {
	position: relative;
	width: 440px;
	height: 452px;
	transform-origin: top left;
	transition: opacity 700ms var(--sortie), filter 700ms var(--sortie);
}

.tij-crypte__corps {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 440px;
}

.tij-crypte__corps > span {
	display: block;
}

.tij-crypte__toit {
	position: relative;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	width: 400px;
	height: 88px;
	padding-bottom: 14px;
	background: var(--ti-plum-600);
	clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.tij-crypte__toit > span {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border: 4px solid var(--ti-plum-500);
	border-radius: 999px;
	background: var(--ti-plum-800);
	color: var(--ti-cherry-400);
	font-size: 16px;
}

.tij-crypte__fronton {
	display: grid;
	place-items: center;
	width: 384px;
	height: 44px;
	background: var(--ti-plum-700);
	color: var(--ti-plum-200);
	font-family: var(--font-display);
	font-size: 30px;
	line-height: 1;
	letter-spacing: 0.04em;
	text-shadow: 0 -1px 0 var(--ti-plum-900);
}

.tij-crypte__facade {
	position: relative;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	width: 364px;
	height: 252px;
	padding: 0 14px;
	background: var(--ti-plum-700);
}

.tij-colonne {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 40px;
	height: 100%;
}

.tij-colonne > span:first-child {
	width: 52px;
	height: 12px;
	border-radius: 3px;
	background: var(--ti-plum-500);
}

.tij-colonne > span:nth-child(2) {
	display: flex;
	flex: 1;
	justify-content: space-evenly;
	width: 36px;
	background: var(--ti-plum-600);
}

.tij-colonne > span:nth-child(2) > span {
	width: 3px;
	background: var(--ti-plum-700);
}

.tij-colonne > span:last-child {
	width: 50px;
	height: 12px;
	border-radius: 3px;
	background: var(--ti-plum-500);
}

.tij-crypte__citrouilles {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

/* La porte : ses battants suivent la phase posée par le script. */
.tij-porte {
	--ang: 0deg;
	position: relative;
	align-self: flex-end;
	width: 196px;
	height: 236px;
	border: 8px solid var(--ti-plum-500);
	border-bottom: none;
	border-radius: 98px 98px 0 0;
	background: var(--ti-plum-800);
	perspective: 900px;
	transition: background 500ms var(--sortie), box-shadow 1400ms var(--sortie);
}

.tij-halloween.is-grande .tij-porte {
	border-color: var(--ti-banana-500);
	box-shadow: 0 0 36px 8px rgba(255, 221, 129, 0.3);
}

.tij-halloween:not([data-phase="idle"]) .tij-porte {
	background: var(--ti-banana-300);
	box-shadow: 0 0 40px 6px rgba(255, 221, 129, 0.25);
}

.tij-halloween[data-phase="crack"] .tij-porte {
	--ang: 16deg;
}

.tij-halloween[data-phase="opening"] .tij-porte,
.tij-halloween[data-phase="reveal"] .tij-porte,
.tij-halloween[data-phase="result"] .tij-porte {
	--ang: 100deg;
	box-shadow: 0 0 110px 30px rgba(255, 221, 129, 0.4);
}

.tij-halloween button.tij-battant {
	position: absolute;
	top: -1px;
	bottom: 0;
	width: calc(50% + 1px);
	min-height: 0;
	padding: 0;
	border: none;
	background: var(--ti-plum-800);
	cursor: pointer;
	transition: transform 2600ms cubic-bezier(0.45, 0.05, 0.2, 1);
}

.tij-halloween[data-phase="crack"] button.tij-battant {
	transition-duration: 1000ms;
	transition-timing-function: cubic-bezier(0.3, 0.7, 0.3, 1);
}

.tij-halloween.sans-email button.tij-battant {
	cursor: not-allowed;
}

.tij-halloween:not([data-phase="idle"]) button.tij-battant {
	cursor: default;
}

.tij-halloween button.tij-battant--g {
	left: -1px;
	border-radius: 90px 0 0 0;
	box-shadow: inset -2px 0 0 var(--ti-plum-900);
	transform: rotateY(calc(-1 * var(--ang)));
	transform-origin: left center;
}

.tij-halloween button.tij-battant--d {
	right: -1px;
	border-radius: 0 90px 0 0;
	box-shadow: inset 2px 0 0 var(--ti-plum-900);
	transform: rotateY(var(--ang));
	transform-origin: right center;
}

.tij-battant__moulure {
	position: absolute;
	top: 18px;
	right: 8px;
	bottom: 16px;
	left: 12px;
	border: 3px solid var(--ti-plum-900);
	border-radius: 70px 4px 6px 6px;
	opacity: 0.8;
}

.tij-battant--d .tij-battant__moulure {
	right: 12px;
	left: 8px;
	border-radius: 4px 70px 6px 6px;
}

.tij-heurtoir {
	position: absolute;
	top: 46%;
	display: flex;
	flex-direction: column;
	align-items: center;
	transform-origin: top center;
}

.tij-battant--g .tij-heurtoir {
	right: 12px;
}

.tij-battant--d .tij-heurtoir {
	left: 12px;
}

.tij-heurtoir > span:first-child {
	width: 10px;
	height: 8px;
	border-radius: 4px 4px 1px 1px;
	background: var(--ti-banana-600);
}

.tij-heurtoir > span:last-child {
	width: 30px;
	height: 30px;
	margin-top: -2px;
	border: 5px solid var(--ti-banana-500);
	border-radius: 999px;
}

.tij-halloween[data-phase="reveal"] .tij-crypte__echelle,
.tij-halloween[data-phase="result"] .tij-crypte__echelle {
	opacity: 0.4;
	filter: blur(2px);
}

/* =============================================================================
   Le seuil : adresse mail, puis les trois tocs
   ============================================================================= */

.tij-seuil {
	position: relative;
	z-index: 1;
	display: flex;
	justify-content: center;
	padding: 8px 20px 20px;
	background: var(--ti-plum-900);
	transition: opacity 300ms var(--sortie);
}

.tij-halloween.is-large .tij-seuil {
	min-height: 230px;
	padding-bottom: 48px;
}

.tij-halloween[data-phase="reveal"] .tij-seuil,
.tij-halloween[data-phase="result"] .tij-seuil {
	opacity: 0;
}

/* Période : formulaire ou message, selon data-periode (corrigé par le script). */
.tij-halloween:not([data-periode="ouvert"]) .tij-formulaire,
.tij-halloween:not([data-periode="ouvert"]) .tij-toquer,
.tij-halloween .tij-ferme {
	display: none !important;
}

.tij-halloween[data-periode="avant"] .tij-ferme--avant,
.tij-halloween[data-periode="apres"] .tij-ferme--apres {
	display: block !important;
}

/* Avant l'ouverture : l'annonce en titre, puis « Préviens-moi » dessous,
   empilés et centrés à toutes les largeurs. */
.tij-avant {
	display: none;
	flex-direction: column;
	align-items: center;
	gap: 20px;
	width: 100%;
	max-width: 520px;
	margin: 0 auto;
}

.tij-halloween[data-periode="avant"] .tij-avant {
	display: flex;
}

.tij-halloween .tij-avant p.tij-avant__annonce {
	margin: 12px 0 0;
	color: var(--ti-white);
	font-family: var(--font-display);
	font-size: clamp(24px, 5vw, 32px);
	font-weight: 400;
	line-height: 1.15;
	text-align: center;
	text-wrap: balance;
}

.tij-prevenir {
	display: none;
	flex-direction: column;
	gap: 10px;
	width: 100%;
	padding-top: 20px;
	border-top: 1px dashed rgba(255, 255, 255, 0.18);
}

.tij-prevenir__titre {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	color: var(--ti-plum-200);
	font-size: 15px;
	font-weight: 700;
	text-align: center;
}

.tij-prevenir__titre > * {
	flex: none;
	font-size: 16px;
}

@media (max-width: 480px) {
	.tij-prevenir .tij-formulaire__ligne .tij-bouton {
		flex: 1 1 100%;
		justify-content: center;
	}
}

.tij-halloween[data-periode="avant"] .tij-prevenir {
	display: flex;
}

.tij-halloween .tij-prevenir__merci {
	margin: 0;
	color: var(--ti-mint-400);
	font-size: 16px;
	font-weight: 800;
	text-align: center;
}

.tij-prevenir [hidden] {
	display: none !important;
}

.tij-halloween p.tij-ferme {
	max-width: 480px;
	margin: 16px auto;
	color: var(--ti-plum-100);
	font-size: 17px;
	font-weight: 700;
	text-align: center;
}

.tij-formulaire {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
	max-width: 480px;
}

.tij-formulaire[hidden] {
	display: none;
}

.tij-formulaire__titre {
	color: var(--ti-white);
	font-size: 17px;
	font-weight: 800;
	text-align: center;
}

.tij-formulaire__ligne {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.tij-halloween input.tij-champ {
	flex: 999 1 220px;
	min-width: 0;
	height: 48px;
	margin: 0;
	padding: 0 20px;
	border: 2px solid transparent;
	border-radius: 999px;
	background: var(--ti-white);
	box-shadow: none;
	color: var(--ti-ink);
	font-family: inherit;
	font-size: 16px;
}

.tij-halloween input.tij-champ::placeholder {
	color: var(--ti-mauve-500);
}

.tij-halloween input.tij-champ:focus {
	border-color: var(--ti-cherry-300);
	box-shadow: 0 0 0 4px var(--ti-cherry-200), 0 0 18px 4px rgba(255, 211, 226, 0.35);
	outline: none;
}

.tij-halloween input.tij-champ.is-erreur {
	border-color: var(--ti-cherry-400);
}

.tij-halloween .tij-bouton {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 48px;
	padding: 0 22px;
	border: none;
	border-radius: 999px;
	background: var(--ti-cherry-500);
	color: var(--ti-white);
	font-size: 16px;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: transform 140ms var(--ressort), box-shadow 140ms var(--sortie);
}

.tij-halloween .tij-bouton:hover {
	color: var(--ti-white);
	box-shadow: 0 8px 20px rgba(255, 111, 165, 0.35);
	transform: translateY(-2px);
}

.tij-halloween .tij-bouton:active {
	transform: scale(0.97);
}

.tij-formulaire .tij-bouton {
	flex: 1 0 auto;
}

.tij-piege {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.tij-erreur {
	color: var(--ti-cherry-300);
	font-size: 14.5px;
	font-weight: 600;
	text-align: center;
}

.tij-erreur[hidden] {
	display: none;
}

.tij-optin {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	cursor: pointer;
}

.tij-optin input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
}

.tij-optin__case {
	display: grid;
	flex: 0 0 auto;
	place-items: center;
	width: 28px;
	height: 28px;
	border: 2px solid var(--ti-plum-300);
	border-radius: 9px;
	color: var(--ti-white);
	font-size: 16px;
	transition: background 140ms var(--sortie), border-color 140ms var(--sortie), transform 140ms var(--ressort);
}

.tij-optin__case > * {
	opacity: 0;
	transform: scale(0.4);
	transition: opacity 140ms var(--sortie), transform 240ms var(--ressort);
}

.tij-optin input:checked + .tij-optin__case {
	border-color: var(--ti-cherry-500);
	background: var(--ti-cherry-500);
}

.tij-optin input:checked + .tij-optin__case > * {
	opacity: 1;
	transform: scale(1);
}

.tij-optin input:focus-visible + .tij-optin__case {
	box-shadow: 0 0 0 4px var(--ti-cherry-200);
}

.tij-optin:active .tij-optin__case {
	transform: scale(0.9);
}

.tij-optin__texte {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 8px;
	color: var(--ti-plum-100);
	font-size: 14.5px;
	line-height: 1.45;
}

.tij-facultatif {
	padding: 2px 9px;
	border: 1px solid var(--ti-plum-400);
	border-radius: 999px;
	color: var(--ti-plum-200);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.tij-halloween p.tij-mention {
	margin: 0;
	padding: 0;
	color: var(--ti-plum-200);
	font-size: 13px;
	line-height: 1.5;
	text-align: center;
	text-wrap: pretty;
}

.tij-toquer {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	text-align: center;
}

.tij-toquer[hidden] {
	display: none;
}

.tij-toquer__indice {
	color: var(--ti-white);
	font-size: 18px;
	font-weight: 800;
}

.tij-toquer__points {
	display: flex;
	gap: 8px;
}

.tij-toquer__points > span {
	width: 12px;
	height: 12px;
	border: 2px solid var(--ti-banana-500);
	border-radius: 999px;
	transition: background 200ms var(--sortie);
}

.tij-toquer__points > span.is-on {
	background: var(--ti-banana-500);
}

.tij-halloween button.tij-lien {
	min-height: 40px;
	padding: 0 12px;
	border: none;
	border-radius: 999px;
	background: transparent;
	color: var(--ti-plum-200);
	font-size: 13.5px;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

/* =============================================================================
   Le résultat
   ============================================================================= */

.tij-voile {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 5;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 16px 16px 40px;
	opacity: 0;
	pointer-events: none;
}

.tij-halloween[data-phase="reveal"] .tij-voile,
.tij-halloween[data-phase="result"] .tij-voile {
	opacity: 1;
	pointer-events: auto;
}

.tij-figure {
	position: relative;
	z-index: 2;
	display: flex;
	justify-content: center;
	margin-bottom: -26px;
}

.tij-bonbon {
	display: flex;
	align-items: center;
}

.tij-bonbon[hidden],
.tij-fantome-sort[hidden] {
	display: none;
}

.tij-bonbon__g,
.tij-bonbon__d {
	width: 42px;
	height: 64px;
	border-radius: 6px;
	background: var(--c2, #FF8FBB);
}

.tij-bonbon__g {
	margin-right: -4px;
	clip-path: polygon(0 0, 100% 38%, 100% 62%, 0 100%);
}

.tij-bonbon__d {
	margin-left: -4px;
	clip-path: polygon(0 38%, 100% 0, 100% 100%, 0 62%);
}

.tij-bonbon__corps {
	position: relative;
	width: 124px;
	height: 84px;
	border-radius: 999px;
	background: var(--c1, #FF6FA5);
	box-shadow: 0 14px 30px rgba(31, 18, 48, 0.35), inset 0 -8px 0 rgba(45, 27, 71, 0.12);
}

.tij-bonbon__corps > span {
	position: absolute;
	top: 14px;
	left: 22px;
	width: 34px;
	height: 14px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.55);
}

.tij-fantome-sort {
	display: block;
	color: var(--ti-plum-200);
	font-size: 120px;
	line-height: 1;
	filter: drop-shadow(0 12px 30px rgba(200, 151, 234, 0.45));
}

.tij-carte {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	width: min(440px, 100%);
	padding: 40px clamp(18px, 4vw, 26px) 22px;
	border-radius: 28px;
	background: var(--ti-white);
	box-shadow: var(--sh-3);
	color: var(--ti-ink);
	text-align: center;
}

.tij-carte__deja {
	padding: 4px 12px;
	border-radius: 999px;
	background: var(--ti-plum-50);
	color: var(--ti-plum-600);
	font-size: 13px;
	font-weight: 700;
}

.tij-carte__bonbon,
.tij-carte__sort {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	width: 100%;
}

.tij-carte [hidden] {
	display: none !important;
}

.tij-carte__surtitre {
	color: var(--ti-cherry-700);
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.tij-carte__surtitre--prune {
	color: var(--ti-plum-600);
}

.tij-carte__titre {
	font-family: var(--font-display);
	font-size: clamp(38px, 6vw, 48px);
	line-height: 1;
}

.tij-carte__texte,
.tij-carte__petit {
	color: var(--ti-mauve-500);
	font-size: 15px;
	line-height: 1.5;
	text-wrap: pretty;
}

.tij-carte__petit {
	font-size: 13px;
}

.tij-carte__sortilege {
	color: var(--ti-ink);
	font-size: 17px;
	line-height: 1.5;
	text-wrap: pretty;
}

.tij-carte__code {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	width: 100%;
	margin-top: 4px;
}

.tij-carte__code > span {
	flex: 1 1 160px;
	min-width: 0;
	padding: 11px 12px;
	border: 2px dashed var(--ti-plum-300);
	border-radius: 14px;
	color: var(--ti-plum-600);
	font-size: 20px;
	font-weight: 800;
	letter-spacing: 0.1em;
}

/* Code scellé : un faux code flouté, une brume qui passe dessus, et une
   étiquette « Envoyé par e-mail ». Le vrai code n'est que dans l'e-mail. */
.tij-carte__code.is-scelle {
	position: relative;
	isolation: isolate;
}

.tij-carte__code.is-scelle > span[data-el="code"] {
	filter: blur(7px);
	opacity: 0.75;
	user-select: none;
	pointer-events: none;
}

.tij-scelle {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: grid;
	place-items: center;
	overflow: hidden;
	border-radius: 14px;
	pointer-events: none;
}

.tij-scelle[hidden] {
	display: none;
}

.tij-scelle__brume {
	position: absolute;
	inset: -20% -60%;
	background:
		radial-gradient(40% 60% at 20% 50%, rgba(242, 230, 251, 0.95), transparent 70%),
		radial-gradient(35% 55% at 55% 40%, rgba(226, 204, 245, 0.9), transparent 70%),
		radial-gradient(40% 60% at 85% 60%, rgba(242, 230, 251, 0.95), transparent 70%);
	animation: tij-brume-code 7s ease-in-out infinite alternate;
}

.tij-scelle__mot {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--ti-plum-600);
	color: var(--ti-white);
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.02em;
	box-shadow: 0 4px 12px rgba(45, 27, 71, 0.25);
	transform: rotate(-3deg);
	animation: tij-scelle-mot 2.6s ease-in-out infinite alternate;
}

@keyframes tij-brume-code {
	from { transform: translateX(-12%); }
	to { transform: translateX(12%); }
}

@keyframes tij-scelle-mot {
	from { transform: rotate(-3deg) translateY(0); }
	to { transform: rotate(2deg) translateY(-2px); }
}

.tij-halloween.is-doux .tij-scelle__brume,
.tij-halloween.is-doux .tij-scelle__mot {
	animation: none;
}

@media (prefers-reduced-motion: reduce) {
	.tij-scelle__brume,
	.tij-scelle__mot {
		animation: none;
	}
}

.tij-halloween .tij-bouton--contour {
	flex: 0 0 auto;
	height: 48px;
	padding: 0 16px;
	border: 1.5px solid var(--ti-plum-300);
	background: transparent;
	color: var(--ti-plum-600);
	font-size: 14.5px;
}

.tij-halloween .tij-bouton--contour:hover {
	color: var(--ti-plum-600);
	box-shadow: none;
}

.tij-halloween .tij-bouton--doux {
	height: auto;
	min-height: 48px;
	background: var(--ti-plum-50);
	color: var(--ti-plum-600);
	font-size: 15px;
}

.tij-halloween .tij-bouton--doux:hover {
	color: var(--ti-plum-600);
	box-shadow: none;
}

.tij-voile .tij-lien {
	margin-top: 10px;
}

.tij-voile [hidden] {
	display: none !important;
}

/* =============================================================================
   Règles et calendrier du mois
   ============================================================================= */

.tij-extras {
	position: relative;
	z-index: 6;
	display: flex;
	flex-direction: column-reverse;
	align-items: center;
	gap: 16px;
	width: calc(100% - 40px);
	max-width: 340px;
	margin: 0 auto 32px;
}

.tij-halloween.is-large .tij-extras {
	position: absolute;
	right: 24px;
	bottom: 28px;
	left: 24px;
	flex-direction: row;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	width: auto;
	max-width: none;
	margin: 0;
	pointer-events: none;
}

.tij-halloween.is-large .tij-extras > * {
	pointer-events: auto;
}

.tij-regles {
	position: relative;
}

.tij-halloween button.tij-pastille {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 36px;
	padding: 0 14px 0 10px;
	border: 1px solid var(--ti-plum-700);
	border-radius: 999px;
	background: var(--ti-plum-900);
	color: var(--ti-plum-200);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.tij-pastille .tia-lucide,
.tij-pastille .tia-icone {
	font-size: 16px;
}

.tij-regles__pop {
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	z-index: 3;
	width: 300px;
	max-width: calc(100vw - 40px);
	padding: 14px 16px;
	border: 1px solid var(--ti-plum-700);
	border-radius: 16px;
	background: var(--ti-plum-800);
	box-shadow: var(--sh-3);
	transform: translateX(-50%);
}

.tij-regles__pop[hidden] {
	display: none;
}

.tij-halloween.is-large .tij-regles__pop {
	left: 0;
	transform: none;
}

.tij-halloween .tij-regles__pop ul {
	display: flex;
	flex-direction: column;
	gap: 9px;
	margin: 0;
	padding: 0;
	color: var(--ti-plum-100);
	font-size: 13.5px;
	line-height: 1.45;
	list-style: none;
	text-align: left;
}

.tij-halloween .tij-regles__pop li {
	display: flex;
	gap: 10px;
	margin: 0;
	padding: 0;
}

.tij-regles__pop li > .tia-lucide,
.tij-regles__pop li > .tia-icone {
	flex: 0 0 auto;
	margin-top: 1px;
	color: var(--ti-plum-300);
	font-size: 17px;
}

.tij-mois {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 2px;
	width: 100%;
}

.tij-mois[hidden] {
	display: none;
}

.tij-halloween.is-large .tij-mois {
	width: 248px;
}

.tij-mois__tete {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	color: var(--ti-plum-200);
	font-size: 12px;
}

.tij-mois__tete > span:first-child {
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.tij-mois__bande {
	display: grid;
	grid-template-columns: repeat(var(--n, 31), minmax(0, 1fr));
	height: 26px;
	margin-top: 4px;
	border-radius: 8px;
	cursor: pointer;
	touch-action: pan-y;
}

.tij-mois__bande > span {
	display: grid;
	place-items: center;
	pointer-events: none;
}

.tij-point {
	display: block;
	width: 4px;
	height: 4px;
	border-radius: 999px;
	background: var(--ti-plum-600);
	transition: transform 140ms var(--ressort);
}

.tij-point.is-sel {
	transform: scale(1.7);
}

.tij-point--bonbon,
.tij-point--sort,
.tij-point--rate {
	width: 6px;
	height: 6px;
}

.tij-point--bonbon {
	background: var(--ti-cherry-400);
}

.tij-point--sort {
	background: var(--ti-plum-300);
}

.tij-point--rate {
	background: transparent;
	box-shadow: inset 0 0 0 1.5px var(--ti-plum-400);
}

.tij-point--aujourdhui {
	width: 8px;
	height: 8px;
	background: var(--ti-banana-500);
	box-shadow: 0 0 6px rgba(255, 221, 129, 0.7);
}

.tij-point--grande {
	background: var(--ti-banana-600);
}

.tij-point--bonbon.is-today,
.tij-point--sort.is-today {
	box-shadow: 0 0 0 2px var(--ti-plum-900), 0 0 0 3.5px var(--ti-banana-500);
}

.tij-mois__pied {
	display: flex;
	justify-content: space-between;
	color: var(--ti-plum-300);
	font-size: 11px;
}

.tij-mois__bulle {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-top: 10px;
	padding: 10px 8px 12px;
	border-radius: 16px;
	background: var(--ti-white);
	box-shadow: var(--sh-2);
}

.tij-mois__bulle[hidden] {
	display: none;
}

.tij-halloween.is-large .tij-mois__bulle {
	position: absolute;
	bottom: calc(100% + 10px);
	left: var(--p, 50%);
	z-index: 2;
	width: 236px;
	max-width: calc(100vw - 40px);
	margin: 0;
	padding: 11px 14px 12px;
	box-shadow: var(--sh-3);
	transform: translateX(calc(-1 * var(--p, 50%)));
	pointer-events: none;
}

.tij-mois__nav {
	display: grid;
	grid-template-columns: 44px minmax(0, 1fr) 44px;
	align-items: center;
}

.tij-mois__nav > div {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	text-align: center;
}

.tij-halloween .tij-mois__nav button {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: none;
	border-radius: 999px;
	background: transparent;
	color: var(--ti-plum-600);
	font-size: 18px;
	cursor: pointer;
}

.tij-halloween .tij-mois__nav button:disabled {
	opacity: 0.3;
	cursor: default;
}

.tij-halloween.is-large .tij-mois__nav {
	display: block;
}

.tij-halloween.is-large .tij-mois__nav button {
	display: none;
}

.tij-halloween.is-large .tij-mois__nav > div {
	align-items: flex-start;
	text-align: left;
}

.tij-mois__date {
	color: var(--ti-plum-500);
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.tij-mois__titre {
	color: var(--ti-ink);
	font-size: 15px;
	font-weight: 800;
}

.tij-mois__texte {
	padding: 0 6px;
	color: var(--ti-mauve-500);
	font-size: 13px;
	line-height: 1.45;
	text-align: center;
	text-wrap: pretty;
}

.tij-halloween.is-large .tij-mois__texte {
	padding: 0;
	text-align: left;
}

.tij-mois__code {
	align-self: center;
	padding: 4px 9px;
	border: 1.5px dashed var(--ti-plum-300);
	border-radius: 9px;
	color: var(--ti-plum-600);
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.1em;
}

.tij-halloween.is-large .tij-mois__code {
	align-self: flex-start;
}

.tij-mois__code[hidden] {
	display: none;
}

/* =============================================================================
   Bandeau du mode test (testeur seulement)
   ============================================================================= */

.tij-halloween .tij-test {
	margin: 0;
	padding: 10px 16px;
	background: var(--ti-banana-400);
	color: var(--ti-plum-900);
	font-size: 14px;
	line-height: 1.4;
	text-align: center;
}

.tij-halloween .tij-test strong {
	margin-right: 6px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}
