/**
 * Labyrinthe CampusInnov — styles publics.
 *
 * Reprend la charte OpenCampusInnov : bleu roi, corail, angles très arrondis,
 * boutons en pilule. La typographie est héritée du thème (Urbanist).
 * Les couleurs sont exposées en variables : elles se règlent ici, en un endroit.
 */

.lci-app {
	--lci-blue: #2438b4;
	--lci-blue-dark: #1a2a8c;
	--lci-coral: #ee5f63;
	--lci-coral-dark: #d94a4e;
	--lci-ink: #16204a;
	--lci-muted: #5a6480;
	--lci-line: #dde2ee;
	--lci-surface: #ffffff;
	--lci-tint: #f2f4fb;
	--lci-radius: 20px;
	--lci-radius-sm: 12px;

	color: var(--lci-ink);
}

/**
 * Un conteneur Elementor réglé sur « Aligner les éléments : centre » réduit
 * chaque enfant à la largeur de son contenu. On neutralise l'effet pour le
 * seul widget qui porte le shortcode : le reste de la page garde son
 * alignement.
 */
.elementor-widget-shortcode:has(.lci-app),
.lci-widget {
	align-self: stretch;
	width: 100%;
}

/* --- Panneaux --- */

/* La largeur de lecture est portée par les panneaux, pas par le conteneur
   général : la scène de jeu peut ainsi occuper toute la largeur disponible. */
.lci-panel {
	max-width: 44rem;
	margin: 0 auto;
	background: var(--lci-surface);
	border-radius: var(--lci-radius);
	box-shadow: 0 18px 40px -24px rgba(22, 32, 74, 0.35);
	padding: 2.5rem;
}

.lci-panel__title {
	margin: 0 0 0.75rem;
	font-size: clamp(1.5rem, 3vw, 2rem);
	line-height: 1.15;
	font-weight: 800;
	color: var(--lci-ink);
}

.lci-panel__lead {
	margin: 0 0 1.75rem;
	color: var(--lci-muted);
	max-width: 60ch;
	line-height: 1.6;
}

/* --- Formulaire --- */

.lci-form__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 1rem;
}

.lci-field {
	margin-bottom: 1.25rem;
}

.lci-field label {
	display: block;
	margin-bottom: 0.4rem;
	font-weight: 700;
	font-size: 0.9375rem;
}

.lci-field input {
	width: 100%;
	box-sizing: border-box;
	padding: 0.8rem 1rem;
	border: 1px solid var(--lci-line);
	border-radius: var(--lci-radius-sm);
	font: inherit;
	font-size: 1rem;
	background: var(--lci-tint);
	color: inherit;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.lci-field input:hover {
	border-color: #c6cee4;
}

.lci-field input:focus-visible {
	outline: 2px solid var(--lci-blue);
	outline-offset: 1px;
	border-color: var(--lci-blue);
	background: #fff;
}

/* --- Boutons --- */

.lci-button {
	display: inline-block;
	padding: 0.85rem 2rem;
	border: 2px solid var(--lci-blue);
	border-radius: 999px;
	background: var(--lci-blue);
	color: #fff;
	font: inherit;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.lci-button:hover:not(:disabled) {
	background: var(--lci-blue-dark);
	border-color: var(--lci-blue-dark);
	color: #fff;
}

.lci-button:disabled {
	opacity: 0.55;
	cursor: default;
}

.lci-button:focus-visible {
	outline: 2px solid var(--lci-ink);
	outline-offset: 3px;
}

.lci-button--ghost {
	background: transparent;
	color: var(--lci-blue);
}

.lci-button--ghost:hover {
	background: var(--lci-blue);
	color: #fff;
}

/* --- Messages --- */

.lci-form__error {
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	border-radius: var(--lci-radius-sm);
	background: #fdeeee;
	color: #a32a2e;
	font-size: 0.9375rem;
	font-weight: 600;
}

.lci-form__notice {
	margin: 1.5rem 0 0;
	font-size: 0.8125rem;
	line-height: 1.6;
	color: var(--lci-muted);
	max-width: 62ch;
}

.lci-form__notice a {
	color: var(--lci-blue);
}

.lci-alert {
	margin: 0 0 1.75rem;
	padding: 1rem 1.25rem;
	border-radius: var(--lci-radius-sm);
	background: #fff6e6;
	font-size: 0.9375rem;
	line-height: 1.55;
}

.lci-notice {
	max-width: 44rem;
	margin: 2rem auto;
	text-align: center;
	padding: 2rem 2.5rem;
	border-radius: 20px;
	background: #f2f4fb;
	color: #16204a;
	line-height: 1.6;
}

.lci-notice--warning {
	background: #fff6e6;
}

.lci-notice p:last-child {
	margin-bottom: 0;
}

/* --- Écran de fin --- */

.lci-panel--done {
	text-align: center;
	border: 0;
	box-shadow: 0 24px 50px -28px rgba(36, 56, 180, 0.7);
	background: linear-gradient(160deg, var(--lci-blue) 0%, #3550d8 100%);
	color: #fff;
}

.lci-panel--done .lci-badge {
	background: var(--lci-coral);
	color: #fff;
}

.lci-panel--done .lci-panel__title {
	color: #fff;
}

.lci-panel--done .lci-panel__lead {
	color: rgba(255, 255, 255, 0.85);
	margin-left: auto;
	margin-right: auto;
}

.lci-badge {
	display: inline-block;
	margin: 0 0 1rem;
	padding: 0.35rem 1rem;
	border-radius: 999px;
	background: var(--lci-coral);
	color: #fff;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.lci-done__duration {
	margin: 0 0 1.25rem;
	font-size: 1.125rem;
	font-weight: 700;
	color: #fff;
}

.lci-done__duration strong {
	font-variant-numeric: tabular-nums;
	font-size: 1.5rem;
}

.lci-done__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	justify-content: center;
}

.lci-panel--done .lci-button {
	background: #fff;
	border-color: #fff;
	color: var(--lci-blue);
}

.lci-panel--done .lci-button:hover {
	background: var(--lci-coral);
	border-color: var(--lci-coral);
	color: #fff;
}

.lci-panel--done .lci-button--ghost {
	background: transparent;
	border-color: rgba(255, 255, 255, 0.6);
	color: #fff;
}

.lci-panel--done .lci-button--ghost:hover {
	background: #fff;
	border-color: #fff;
	color: var(--lci-blue);
}

.lci-panel--done .lci-button:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

/* --- Écran d'accueil sur fond bleu ---
   Pour revenir à la carte blanche, il suffit de supprimer ce bloc :
   rien d'autre n'en dépend. Les champs restent clairs volontairement,
   une zone de saisie sombre ne se lit pas comme telle. */

#lci-intro {
	background: linear-gradient(160deg, var(--lci-blue) 0%, #3550d8 100%);
	box-shadow: 0 24px 50px -28px rgba(36, 56, 180, 0.7);
	color: #fff;
}

#lci-intro .lci-panel__title {
	color: #fff;
}

#lci-intro .lci-panel__lead {
	color: rgba(255, 255, 255, 0.85);
}

#lci-intro .lci-field label {
	color: #fff;
}

#lci-intro .lci-field input {
	background: #fff;
	border-color: transparent;
	color: var(--lci-ink);
}

#lci-intro .lci-field input:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
	border-color: #fff;
}

#lci-intro .lci-button {
	background: #fff;
	border-color: #fff;
	color: var(--lci-blue);
}

#lci-intro .lci-button:hover:not(:disabled) {
	background: var(--lci-coral);
	border-color: var(--lci-coral);
	color: #fff;
}

#lci-intro .lci-button:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

#lci-intro .lci-form__notice {
	color: rgba(255, 255, 255, 0.75);
}

#lci-intro .lci-form__notice a {
	color: #fff;
	text-decoration: underline;
}

#lci-intro .lci-alert {
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
}

#lci-intro .lci-form__error {
	background: #fff;
	color: #a32a2e;
}

/* --- Scène de jeu --- */

/* Occupe toute la largeur du conteneur Elementor, sans plafond propre :
   c'est la largeur de la page qui décide. */
/* La scène ne doit jamais dépasser la hauteur de la fenêtre : sans ça, sur un
   grand écran, le jeu pousse la barre de contrôle hors du champ de vision et
   il faut remonter pour trouver « Terminer la partie ». On plafonne donc la
   largeur en fonction de la hauteur disponible, ce qui préserve le 16/9. */
.lci-stage {
	width: 100%;
	max-width: calc((100vh - 17rem) * 16 / 9);
	margin: 0 auto;
	scroll-margin-top: 6rem;
}

/* La barre reste accrochée en haut de la scène tant que le jeu est à l'écran :
   même si le visiteur fait défiler, le chronomètre et le bouton de sortie
   restent accessibles sans avoir à remonter. */
.lci-stage__bar {
	position: sticky;
	top: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.6rem 1rem;
	background: var(--lci-ink);
	border-radius: var(--lci-radius) var(--lci-radius) 0 0;
	color: #fff;
}

.lci-stage__timer {
	font-variant-numeric: tabular-nums;
	font-size: 1.0625rem;
	font-weight: 700;
	letter-spacing: 0.04em;
}

.lci-stage__end {
	padding: 0.4rem 1.1rem;
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.lci-stage__end:hover {
	background: var(--lci-coral);
	border-color: var(--lci-coral);
}

.lci-stage__frame {
	position: relative;
	aspect-ratio: 16 / 9;
	background: var(--lci-ink);
	border-radius: 0 0 var(--lci-radius) var(--lci-radius);
	overflow: hidden;
}

.lci-stage__frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

/* --- Adaptations --- */

@media (max-width: 782px) {
	/* Le conteneur Elementor n'a pas de marge latérale en mobile : sans ça,
	   les cartes collent aux bords de l'écran. */
	.lci-app {
		padding-left: 1rem;
		padding-right: 1rem;
		box-sizing: border-box;
	}

	.lci-notice {
		margin-left: 1rem;
		margin-right: 1rem;
	}
}

@media (max-width: 600px) {
	.lci-panel {
		padding: 1.5rem;
	}

	.lci-form__grid {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.lci-button {
		width: 100%;
		text-align: center;
	}

	.lci-done__actions {
		flex-direction: column;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lci-button,
	.lci-field input,
	.lci-stage__end {
		transition: none;
	}
}
