/* Soirée 80 — ambiance "voyage dans le temps" : nuit, grille néon, titre chromé enflammé,
   compteur de vitesse et éclairs bleus. */

:root {
	--nuit: #07040f;
	--violet: #2a0b4a;
	--magenta: #ff2bd6;
	--cyan: #26e7ff;
	--feu-1: #fff36b;
	--feu-2: #ff9a1f;
	--feu-3: #ff3b1f;
	--rouge-led: #ff2a2a;
	--vert-led: #34ff6a;
	--ambre-led: #ffb627;
	--acier: #c9d1dc;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
	position: relative;
	min-height: 100vh;
	overflow-x: hidden;
	color: #f3eaff;
	font-family: 'Orbitron', 'Share Tech Mono', system-ui, sans-serif;
	background:
		radial-gradient(ellipse at 50% 115%, rgba(255, 43, 214, .45) 0%, rgba(255, 43, 214, 0) 55%),
		linear-gradient(180deg, var(--nuit) 0%, #12062a 45%, var(--violet) 70%, #3d0b4f 100%);
}

/* Étoiles */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background-image:
		radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%),
		radial-gradient(1px 1px at 28% 8%, #fff 50%, transparent 51%),
		radial-gradient(1.5px 1.5px at 43% 22%, #fff 50%, transparent 51%),
		radial-gradient(1px 1px at 61% 12%, #fff 50%, transparent 51%),
		radial-gradient(1px 1px at 74% 28%, #fff 50%, transparent 51%),
		radial-gradient(1.5px 1.5px at 88% 9%, #fff 50%, transparent 51%),
		radial-gradient(1px 1px at 93% 34%, #fff 50%, transparent 51%),
		radial-gradient(1px 1px at 6% 38%, #fff 50%, transparent 51%),
		radial-gradient(1px 1px at 35% 40%, #fff 50%, transparent 51%),
		radial-gradient(1px 1px at 55% 35%, #fff 50%, transparent 51%);
	animation: scintille 4s ease-in-out infinite alternate;
}

@keyframes scintille { from { opacity: .55; } to { opacity: 1; } }

/* Grille néon en perspective, au sol */
.grille {
	position: fixed;
	left: -50%;
	right: -50%;
	bottom: 0;
	height: 45vh;
	z-index: 0;
	pointer-events: none;
	background-image:
		linear-gradient(rgba(38, 231, 255, .55) 2px, transparent 2px),
		linear-gradient(90deg, rgba(255, 43, 214, .55) 2px, transparent 2px);
	background-size: 80px 80px;
	transform: perspective(320px) rotateX(62deg);
	transform-origin: bottom;
	mask-image: linear-gradient(180deg, transparent 0%, #000 60%);
	-webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 60%);
	animation: avance 2.2s linear infinite;
}

@keyframes avance { from { background-position: 0 0; } to { background-position: 0 80px; } }

/* Traînées de feu (pneus en flammes) */
.trainees {
	position: fixed;
	bottom: 0;
	left: 50%;
	z-index: 0;
	width: 220px;
	height: 45vh;
	transform: translateX(-50%) perspective(320px) rotateX(62deg);
	transform-origin: bottom;
	pointer-events: none;
	background:
		linear-gradient(90deg, transparent 18%, var(--feu-3) 19%, var(--feu-1) 22%, var(--feu-3) 25%, transparent 26%,
		                       transparent 74%, var(--feu-3) 75%, var(--feu-1) 78%, var(--feu-3) 81%, transparent 82%);
	mask-image: linear-gradient(180deg, transparent 0%, #000 70%);
	-webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 70%);
	filter: drop-shadow(0 0 10px var(--feu-2));
	opacity: .85;
	animation: flamme .25s ease-in-out infinite alternate;
}

@keyframes flamme { from { opacity: .7; } to { opacity: 1; } }

.scene {
	position: relative;
	z-index: 1;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 4vh 16px 22vh;
}

/* ── Titre chromé enflammé ── */
.titre {
	margin: 0;
	text-align: center;
	line-height: .9;
	transform: skewX(-8deg);
}

.titre .petit {
	display: block;
	font-family: 'Orbitron', sans-serif;
	font-weight: 700;
	font-size: clamp(.9rem, 2.4vw, 1.3rem);
	letter-spacing: .5em;
	color: var(--acier);
	text-shadow: 0 0 8px rgba(38, 231, 255, .7);
	margin-bottom: .4em;
}

.titre .grand {
	display: block;
	font-family: 'Russo One', 'Orbitron', sans-serif;
	font-size: clamp(2.6rem, 9vw, 6rem);
	text-transform: uppercase;
	letter-spacing: .02em;
	background: linear-gradient(180deg, var(--feu-1) 0%, var(--feu-1) 30%, var(--feu-2) 55%, var(--feu-3) 85%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	-webkit-text-stroke: 2px #4a0d00;
	filter: drop-shadow(0 4px 0 #6b1400) drop-shadow(0 0 18px rgba(255, 120, 30, .65));
}

.titre .grand .chiffre {
	font-size: 1.25em;
}

.soustitre {
	margin: 1.2rem 0 0;
	text-align: center;
	font-family: 'Share Tech Mono', monospace;
	font-size: clamp(.9rem, 2.2vw, 1.15rem);
	color: var(--cyan);
	text-shadow: 0 0 10px rgba(38, 231, 255, .8);
}

/* ── Panneau (formulaire, liste) ── */
.panneau {
	width: min(640px, 100%);
	margin-top: 3vh;
	padding: 22px;
	border-radius: 16px;
	background: rgba(10, 4, 24, .78);
	border: 1px solid rgba(38, 231, 255, .45);
	box-shadow: 0 0 0 1px rgba(255, 43, 214, .25), 0 0 30px rgba(38, 231, 255, .2), inset 0 0 40px rgba(255, 43, 214, .08);
	backdrop-filter: blur(6px);
}

.panneau.large { width: min(1100px, 100%); }

.champ { display: block; margin-bottom: 14px; }

.champ span {
	display: block;
	margin-bottom: 6px;
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .25em;
	color: var(--cyan);
}

.champ input,
.champ select {
	width: 100%;
	padding: 12px 14px;
	border-radius: 10px;
	border: 2px solid #3b2a5c;
	background: #05020c;
	color: var(--vert-led);
	font-family: 'Share Tech Mono', monospace;
	font-size: 1.15rem;
	letter-spacing: .06em;
	outline: none;
	text-shadow: 0 0 6px rgba(52, 255, 106, .6);
	transition: border-color .15s ease, box-shadow .15s ease;
}

.champ select { cursor: pointer; }
.champ select option { color: #111; background: #fff; text-shadow: none; }

.champ input::placeholder { color: #3f6b4c; text-shadow: none; }

.champ input:focus,
.champ select:focus {
	border-color: var(--cyan);
	box-shadow: 0 0 0 3px rgba(38, 231, 255, .25), 0 0 18px rgba(38, 231, 255, .35);
}

.bouton {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 14px 18px;
	border: 0;
	border-radius: 12px;
	cursor: pointer;
	font-family: 'Russo One', 'Orbitron', sans-serif;
	font-size: 1.15rem;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: #2b0700;
	background: linear-gradient(180deg, var(--feu-1), var(--feu-2) 55%, var(--feu-3));
	box-shadow: 0 6px 0 #7a1a00, 0 0 24px rgba(255, 120, 30, .55);
	transition: transform .1s ease, box-shadow .1s ease, filter .15s ease;
}

.bouton:hover { filter: brightness(1.08); }
.bouton:active { transform: translateY(4px); box-shadow: 0 2px 0 #7a1a00, 0 0 24px rgba(255, 120, 30, .55); }
.bouton:disabled { filter: grayscale(.8) brightness(.6); cursor: not-allowed; }

.bouton.secondaire {
	width: auto;
	padding: 9px 14px;
	font-size: .8rem;
	color: var(--cyan);
	background: transparent;
	border: 1px solid rgba(38, 231, 255, .6);
	box-shadow: 0 0 12px rgba(38, 231, 255, .25);
}

.erreur {
	margin-bottom: 14px;
	padding: 10px 12px;
	border-radius: 10px;
	border: 1px solid var(--rouge-led);
	background: rgba(255, 42, 42, .12);
	color: #ffb4b4;
	font-family: 'Share Tech Mono', monospace;
	font-size: .95rem;
}

.succes {
	margin-bottom: 14px;
	padding: 12px 14px;
	border-radius: 10px;
	border: 1px solid var(--vert-led);
	background: rgba(52, 255, 106, .1);
	color: #c8ffd8;
	font-family: 'Share Tech Mono', monospace;
	font-size: 1rem;
}

.note {
	margin: 14px 0 0;
	text-align: center;
	font-family: 'Share Tech Mono', monospace;
	font-size: .85rem;
	color: #a99bc9;
}

/* ── Compteur de vitesse et flash du départ (88 mph) ── */
.vitesse {
	display: none;
	margin-top: 14px;
	text-align: center;
	font-family: 'Share Tech Mono', monospace;
	font-size: 2.6rem;
	color: var(--rouge-led);
	text-shadow: 0 0 12px var(--rouge-led);
}

.vitesse small { font-size: .45em; letter-spacing: .2em; }

.flash {
	position: fixed;
	inset: 0;
	z-index: 50;
	pointer-events: none;
	opacity: 0;
	background: radial-gradient(circle, #fff 0%, #bdf6ff 30%, rgba(38, 231, 255, 0) 70%);
}

.flash.actif { animation: eclair .9s ease-out forwards; }

@keyframes eclair {
	0% { opacity: 0; }
	15% { opacity: 1; }
	30% { opacity: .3; }
	45% { opacity: 1; }
	100% { opacity: 1; }
}

/* ── Condensateur (décor) ── */
.condensateur {
	width: 86px;
	height: 86px;
	margin: 0 auto 6px;
	filter: drop-shadow(0 0 10px rgba(255, 246, 180, .8));
}

.condensateur .branche { animation: pulse 0.6s linear infinite; }
.condensateur .branche:nth-child(2) { animation-delay: .2s; }
.condensateur .branche:nth-child(3) { animation-delay: .4s; }

@keyframes pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* ── Page de vote ── */
.entete-vote {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 16px;
	font-family: 'Share Tech Mono', monospace;
	color: #d9cff2;
}

.entete-vote strong { color: var(--vert-led); text-shadow: 0 0 6px rgba(52, 255, 106, .6); }

.recherche {
	width: 100%;
	margin-bottom: 16px;
}

.candidats {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 14px;
}

.candidat {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 14px 10px 12px;
	border-radius: 14px;
	border: 2px solid #3b2a5c;
	background: linear-gradient(180deg, rgba(42, 11, 74, .7), rgba(7, 4, 15, .9));
	cursor: pointer;
	text-align: center;
	transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.candidat:hover { transform: translateY(-3px); border-color: var(--magenta); box-shadow: 0 0 18px rgba(255, 43, 214, .45); }

.candidat input { position: absolute; opacity: 0; pointer-events: none; }

.candidat:has(input:checked) {
	border-color: var(--feu-2);
	box-shadow: 0 0 0 2px var(--feu-1), 0 0 26px rgba(255, 154, 31, .7);
	transform: translateY(-3px);
}

.candidat .portrait {
	width: 92px;
	height: 92px;
	border-radius: 50%;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--magenta), var(--cyan));
	border: 3px solid #0b0618;
	box-shadow: 0 0 0 2px rgba(38, 231, 255, .5);
	font-family: 'Russo One', sans-serif;
	font-size: 2rem;
	color: #0b0618;
}

.candidat .portrait img { width: 100%; height: 100%; object-fit: cover; }

.candidat .nom {
	font-family: 'Orbitron', sans-serif;
	font-size: .82rem;
	font-weight: 700;
	line-height: 1.25;
	color: #fff;
}

.candidat .secteur {
	font-family: 'Share Tech Mono', monospace;
	font-size: .75rem;
	color: #a99bc9;
}

.candidat .coche {
	position: absolute;
	top: 8px;
	right: 8px;
	display: none;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	align-items: center;
	justify-content: center;
	background: var(--feu-2);
	color: #2b0700;
	font-weight: 900;
}

.candidat:has(input:checked) .coche { display: flex; }

.candidat.mon-vote::after {
	content: "MON VOTE";
	position: absolute;
	top: -10px;
	left: 50%;
	transform: translateX(-50%);
	padding: 2px 8px;
	border-radius: 99px;
	background: var(--vert-led);
	color: #04210c;
	font-size: .6rem;
	font-weight: 900;
	letter-spacing: .15em;
	white-space: nowrap;
}

.barre-vote {
	position: sticky;
	bottom: 14px;
	z-index: 5;
	margin-top: 18px;
}

/* ── Groupes (organisateur) ── */
.groupes { list-style: none; margin: 0 0 16px; padding: 0; }

.groupes li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 8px 0;
	border-bottom: 1px solid rgba(59, 42, 92, .7);
	font-weight: 700;
	color: #fff;
}

.groupes li form { margin: 0; }

.ajout-groupe {
	display: flex;
	align-items: flex-end;
	gap: 10px;
}

.ajout-groupe .champ { flex: 1; margin-bottom: 0; }
.ajout-groupe .bouton { width: auto; white-space: nowrap; }

/* ── Classement (organisateur) ── */
.classement-titre {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 14px;
	font-family: 'Russo One', sans-serif;
	font-size: 1.3rem;
	color: var(--feu-1);
	text-shadow: 0 0 12px rgba(255, 154, 31, .6);
}

.classement-titre span {
	font-family: 'Share Tech Mono', monospace;
	font-size: .9rem;
	color: #a99bc9;
	text-shadow: none;
}

.classement { list-style: none; margin: 0; padding: 0; }

.classement li {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 0;
	border-bottom: 1px solid rgba(59, 42, 92, .7);
}

.classement li:last-child { border-bottom: 0; }

.classement .rang {
	flex-shrink: 0;
	width: 34px;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	border: 1px solid #3b2a5c;
	font-family: 'Russo One', sans-serif;
	color: #d9cff2;
}

.classement .podium-1 .rang { background: linear-gradient(180deg, var(--feu-1), var(--feu-2)); color: #2b0700; border: 0; box-shadow: 0 0 14px rgba(255, 200, 60, .7); }
.classement .podium-2 .rang { background: linear-gradient(180deg, #f1f5f9, #94a3b8); color: #0f172a; border: 0; }
.classement .podium-3 .rang { background: linear-gradient(180deg, #f3b07a, #b45309); color: #2b0700; border: 0; }

.classement .qui { flex: 1; min-width: 0; }

.classement .nom {
	display: block;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	font-size: .9rem;
	font-weight: 700;
	color: #fff;
}

.classement .jauge {
	display: block;
	height: 6px;
	margin-top: 5px;
	border-radius: 99px;
	background: rgba(59, 42, 92, .8);
	overflow: hidden;
}

.classement .jauge span {
	display: block;
	height: 100%;
	border-radius: 99px;
	background: linear-gradient(90deg, var(--magenta), var(--cyan));
	box-shadow: 0 0 8px rgba(38, 231, 255, .6);
}

.classement .nb {
	flex-shrink: 0;
	min-width: 2.2em;
	text-align: right;
	font-family: 'Share Tech Mono', monospace;
	font-size: 1.4rem;
	color: var(--vert-led);
	text-shadow: 0 0 8px rgba(52, 255, 106, .6);
}

@media (max-width: 520px) {
	.candidats { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
	.grille, .trainees, body::before, .condensateur .branche { animation: none; }
}
