/* Quiz infernal Animateur — feuille de réponses et corrigé (voir sheet.js).
 * Noir et blanc par défaut : traits, graisses, gris clairs (≤ 15 %) et hachures ; jamais de grands
 * aplats noirs. .qsh-color ajoute les accents (violet, jaune, rouge). */

.qsh {
	--qsh-w: 191mm;          /* zone imprimable : lettre 215,9 × 279,4 mm moins 2 × 12 mm */
	--qsh-h: 254.5mm;
	--qsh-ink: #111;
	--qsh-mute: #555;
	--qsh-rule: #b8b8b8;
	--qsh-soft: #ededed;     /* bandeaux d'en-tête (≈ 7 % de gris) */
	--qsh-frame: #222;
	--qsh-acc: #111;         /* titres, cadres forts */
	--qsh-hl-bg: #111;       /* bonne réponse (corrigé) */
	--qsh-hl-fg: #fff;
	--qsh-warn: #111;
	--qsh-hatch: rgba(0, 0, 0, .13);
	display: block;
	box-sizing: border-box;
	padding: 16px;
	background: #d4d4d9;
	color: var(--qsh-ink);
	font-family: "Atkinson Hyperlegible", "Segoe UI", Arial, sans-serif;
	overflow-x: auto;
	-webkit-print-color-adjust: exact;
	print-color-adjust: exact;
}
.qsh.qsh-a4 { --qsh-w: 185.5mm; --qsh-h: 272mm; }
.qsh.qsh-color {
	--qsh-soft: #efeafb;
	--qsh-frame: #31038a;
	--qsh-acc: #31038a;
	--qsh-hl-bg: #fdd018;
	--qsh-hl-fg: #1a0550;
	--qsh-warn: #ff4343;
	--qsh-hatch: rgba(49, 3, 138, .16);
}
.qsh *, .qsh *::before, .qsh *::after { box-sizing: border-box; }
.qsh h1, .qsh h2 { margin: 0; }

/* ——— Pages ——— */

.qsh-page {
	width: calc(var(--qsh-w) + 24mm);
	height: calc(var(--qsh-h) + 24mm);
	padding: 12mm;
	margin: 0 auto 16px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .18), 0 8px 24px rgba(0, 0, 0, .14);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	font-size: 10.5pt;
	line-height: 1.25;
}
.qsh-page.qsh-flow { height: auto; min-height: calc(var(--qsh-h) + 24mm); }
.qsh-body { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.qsh-body > .qsh-probe { height: 0; margin: 0; }
.qsh-flow .qsh-body { overflow: visible; }
.qsh-body > * { margin-bottom: 3mm; }

@media screen and (max-width: 900px) {
	.qsh { padding: 10px; }
	.qsh-page { zoom: .75; }
}
@media screen and (max-width: 640px) {
	.qsh { padding: 8px; }
	.qsh-page { zoom: .44; margin-bottom: 10px; }
}
/* Mesure du découpage : toujours à l'échelle réelle. */
.qsh.qsh-measuring .qsh-page { zoom: 1; }

/* ——— Pied et en-tête courant ——— */

.qsh-foot {
	flex: 0 0 10.5mm;
	margin-top: 1.5mm;
	padding-top: 1mm;
	border-top: .3mm solid var(--qsh-frame);
	display: flex;
	align-items: center;
	gap: 4mm;
	font-size: 8pt;
	color: var(--qsh-mute);
}
.qsh-foot-l, .qsh-foot-r { display: flex; align-items: center; gap: 2.5mm; }
.qsh-foot-m { flex: 1; text-align: center; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--qsh-warn); }
.qsh-flogo { height: 6mm; width: auto; }
.qsh-site { font-weight: 700; color: var(--qsh-ink); }
.qsh-qr { width: 9mm; height: 9mm; }
.qsh-pno { white-space: nowrap; }

.qsh-run {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 6mm;
	padding-bottom: .8mm;
	border-bottom: .2mm solid var(--qsh-rule);
	font-size: 8pt;
	color: var(--qsh-mute);
}
.qsh-run-t { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qsh-run-k { font-family: "Bungee", "Arial Black", Impact, sans-serif; color: var(--qsh-warn); }
.qsh-run .qsh-rteam .qsh-line { width: 55mm; height: 5mm; }

/* ——— Lignes d'écriture ——— */

.qsh-line {
	display: flex;
	align-items: flex-end;
	min-width: 0;
	height: 9mm;
	border-bottom: .3mm solid var(--qsh-ink);
	padding: 0 1mm .6mm;
}
.qsh-ans { font-weight: 700; font-size: 11pt; line-height: 1.15; }
.qsh-key .qsh-line { height: auto; min-height: 7mm; border-bottom-style: dotted; border-bottom-color: var(--qsh-mute); }

/* ——— En-tête de la première page ——— */

.qsh-head {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 5mm;
}
.qsh-logos { display: flex; align-items: center; gap: 3mm; min-width: 16mm; }
.qsh-logos-r { justify-content: flex-end; }
.qsh-logo { height: 15mm; width: auto; max-width: 42mm; object-fit: contain; }
.qsh-bw .qsh-logo, .qsh-bw .qsh-flogo { filter: grayscale(1); }
.qsh-htext { text-align: center; min-width: 0; }
.qsh-kind { font-size: 8.5pt; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--qsh-mute); }
.qsh-key .qsh-kind { font-family: "Bungee", "Arial Black", Impact, sans-serif; font-size: 13pt; letter-spacing: .04em; color: var(--qsh-warn); }
.qsh-title {
	font-family: "Bungee", "Arial Black", Impact, sans-serif;
	font-weight: 400;
	font-size: 17pt;
	line-height: 1.1;
	margin: .8mm 0;
	color: var(--qsh-acc);
	overflow-wrap: anywhere;
}
.qsh-venue { font-weight: 700; font-size: 11pt; }
.qsh-date { display: inline-flex; align-items: flex-end; gap: 2mm; margin-top: 1mm; font-size: 9.5pt; }
.qsh-date .qsh-line { width: 42mm; height: 6.5mm; }
.qsh-headwrap .qsh-head { margin-bottom: 3mm; }
.qsh-warn {
	padding: 2mm 3mm;
	border: .5mm solid var(--qsh-warn);
	border-radius: 1.5mm;
	text-align: center;
	font-weight: 700;
	font-size: 10.5pt;
	text-transform: uppercase;
	letter-spacing: .08em;
	background: repeating-linear-gradient(135deg, transparent 0 2.2mm, var(--qsh-hatch) 2.2mm 2.8mm), #fff;
}
.qsh-color .qsh-warn { color: #b30000; }

/* ——— Équipe ——— */

.qsh-label { font-weight: 700; font-size: 9pt; text-transform: uppercase; letter-spacing: .08em; color: var(--qsh-mute); }
.qsh-team {
	height: 17mm;
	border: .7mm solid var(--qsh-frame);
	border-radius: 2mm;
	padding: 1.5mm 3mm;
}
.qsh-members {
	border: .3mm solid var(--qsh-frame);
	border-radius: 2mm;
	padding: 1.5mm 3mm 2.5mm;
}
.qsh-mgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 6mm; }
.qsh-mgrid.is-short { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qsh-li { display: flex; align-items: flex-end; gap: 1.5mm; min-width: 0; }
.qsh-li .qsh-line { flex: 1; }
.qsh-lin { flex: 0 0 auto; min-width: 5mm; padding-bottom: .8mm; font-size: 8.5pt; font-weight: 700; color: var(--qsh-mute); text-align: right; }

/* ——— Cadres (rondes, arrivés tôt, thème, départage) ——— */

.qsh-frame {
	border: .4mm solid var(--qsh-frame);
	border-radius: 2mm;
	overflow: hidden;
	background: #fff;
}
.qsh-fhead {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 5mm;
	padding: 1mm 3mm;
	background: var(--qsh-soft);
	border-bottom: .3mm solid var(--qsh-frame);
}
.qsh-color .qsh-fhead { border-left: 2.2mm solid #31038a; }
.qsh-ftitles { min-width: 0; }
.qsh-ftitle {
	font-family: "Bungee", "Arial Black", Impact, sans-serif;
	font-weight: 400;
	font-size: 12pt;
	line-height: 1.15;
	color: var(--qsh-acc);
	overflow-wrap: anywhere;
}
.qsh-cont { font-family: "Atkinson Hyperlegible", "Segoe UI", Arial, sans-serif; font-size: 9pt; color: var(--qsh-mute); }
.qsh-fsub { font-size: 9pt; color: var(--qsh-mute); margin-top: .3mm; }
.qsh-rteam { display: flex; align-items: flex-end; gap: 2mm; flex: 0 0 auto; font-size: 8.5pt; font-weight: 700; color: var(--qsh-mute); }
.qsh-rteam .qsh-line { width: 58mm; height: 6.5mm; background: #fff; }
.qsh-early .qsh-fhead, .qsh-topic .qsh-fhead, .qsh-tiebreak .qsh-fhead {
	background: repeating-linear-gradient(135deg, transparent 0 2.2mm, var(--qsh-hatch) 2.2mm 2.6mm), var(--qsh-soft);
}

/* ——— Questions ——— */

.qsh-q {
	display: grid;
	grid-template-columns: 8mm minmax(0, 1fr) 17mm;
	align-items: center;
	column-gap: 2.5mm;
	padding: .4mm 3mm .5mm;
	border-top: .2mm solid var(--qsh-rule);
	break-inside: avoid;
	page-break-inside: avoid;
}
.qsh-fhead + .qsh-q { border-top: 0; }
.qsh-q.qsh-nonum { grid-template-columns: minmax(0, 1fr) 17mm; }
.qsh-tiebreak .qsh-q.qsh-nonum { grid-template-columns: minmax(0, 1fr); }
.qsh-num {
	font-family: "Bungee", "Arial Black", Impact, sans-serif;
	font-size: 12pt;
	text-align: center;
	color: var(--qsh-acc);
}
.qsh-main { min-width: 0; }
.qsh-text { font-size: 10pt; line-height: 1.3; margin-bottom: .6mm; overflow-wrap: anywhere; }
.qsh-text strong { font-weight: 700; }
.qsh-media { font-variant-emoji: text; font-size: 8.5pt; color: var(--qsh-mute); margin-bottom: .6mm; }
.qsh-notes { font-size: 8.5pt; font-style: italic; color: var(--qsh-mute); margin-top: .8mm; overflow-wrap: anywhere; }
.qsh-meta { font-size: 8.5pt; color: var(--qsh-mute); margin-top: .6mm; }
.qsh-empty { padding: 3mm; font-style: italic; color: var(--qsh-mute); }

/* Case de points */
.qsh-pts {
	position: relative;
	height: 8.5mm;
	border: .35mm solid var(--qsh-ink);
	border-radius: 1mm;
	display: flex;
	align-items: center;
	justify-content: center;
}
.qsh-pts-max {
	position: absolute;
	right: 1mm;
	bottom: .5mm;
	font-size: 7.5pt;
	font-weight: 700;
	color: var(--qsh-mute);
}
.qsh-pts-val { font-weight: 700; font-size: 11.5pt; }
.qsh-key .qsh-pts { border-style: dashed; border-color: var(--qsh-mute); }

/* Choix de réponses et vrai / faux */
.qsh-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2mm 4.5mm; min-height: 8.5mm; }
.qsh-opt { display: inline-flex; align-items: center; gap: 1.6mm; min-width: 0; max-width: 100%; }
.qsh-box {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 7.5mm;
	height: 7.5mm;
	border: .35mm solid var(--qsh-ink);
	border-radius: 1mm;
	font-weight: 700;
	font-size: 10.5pt;
}
.qsh-box-wide { width: auto; min-width: 16mm; padding: 0 2.5mm; }
.qsh-optt { font-size: 9.5pt; line-height: 1.2; overflow-wrap: anywhere; }
.qsh-opts.has-text .qsh-opt { flex: 0 1 auto; }
.qsh-key .qsh-opt { color: var(--qsh-mute); }
.qsh-key .qsh-opt .qsh-box { border-color: var(--qsh-rule); }
.qsh-opt.is-correct { color: var(--qsh-ink); font-weight: 700; }
.qsh-key .qsh-opt.is-correct .qsh-box { background: var(--qsh-hl-bg); color: var(--qsh-hl-fg); border-color: var(--qsh-ink); }
.qsh-opt.is-correct .qsh-optt { text-decoration: underline; text-decoration-thickness: .3mm; text-underline-offset: .6mm; }

/* Réponses ouvertes */
.qsh-parts { display: flex; flex-wrap: wrap; column-gap: 5mm; row-gap: .5mm; }
.qsh-part { display: flex; align-items: flex-end; gap: 1.5mm; min-width: 0; }
.qsh-part .qsh-line { flex: 1 1 auto; }
.qsh-s-word { flex: 0 1 48mm; }
.qsh-s-phrase { flex: 1 1 70mm; }
.qsh-s-long { flex: 1 1 100%; }
.qsh-key .qsh-part { flex-basis: auto; flex-grow: 1; }
.qsh-plabel { flex: 0 0 auto; padding-bottom: .8mm; font-size: 9pt; font-weight: 700; color: var(--qsh-mute); white-space: nowrap; }
.qsh-ppts { flex: 0 0 auto; padding-bottom: .8mm; font-size: 8pt; color: var(--qsh-mute); white-space: nowrap; }

/* Listes */
.qsh-list { display: grid; column-gap: 5mm; }
.qsh-listwrap .qsh-li .qsh-line { height: 9mm; }
.qsh-key .qsh-listwrap .qsh-li .qsh-line { height: auto; min-height: 6mm; }
.qsh-key .qsh-listwrap .qsh-ans { font-size: 10pt; }

/* Nombres */
.qsh-number { display: flex; align-items: flex-end; gap: 2mm; min-height: 8.5mm; }
.qsh-nbox {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38mm;
	height: 9mm;
	border: .35mm solid var(--qsh-ink);
	border-radius: 1mm;
}
.qsh-key .qsh-nbox { width: auto; min-width: 24mm; padding: 0 3mm; border-style: dashed; }
.qsh-unit { padding-bottom: 1mm; font-weight: 700; font-size: 10pt; }

/* Sous-total d'une ronde */
.qsh-sub {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 3mm;
	padding: .8mm 3mm;
	border-top: .3mm solid var(--qsh-frame);
	background: repeating-linear-gradient(135deg, transparent 0 2.2mm, var(--qsh-hatch) 2.2mm 2.6mm);
	break-inside: avoid;
}
.qsh-slabel { font-weight: 700; font-size: 9.5pt; text-transform: uppercase; letter-spacing: .05em; background: #fff; padding: 0 1.5mm; }
.qsh-sbox {
	position: relative;
	width: 24mm;
	height: 8.5mm;
	border: .6mm solid var(--qsh-frame);
	border-radius: 1.2mm;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Total */
.qsh-total {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 5mm;
	padding: 2mm 4mm;
	border: .7mm solid var(--qsh-frame);
	border-radius: 2mm;
	background: repeating-linear-gradient(135deg, transparent 0 2.2mm, var(--qsh-hatch) 2.2mm 2.8mm), #fff;
}
.qsh-tlabel { display: flex; flex-direction: column; align-items: flex-end; background: #fff; padding: .5mm 2mm; border-radius: 1mm; }
.qsh-ttitle { font-family: "Bungee", "Arial Black", Impact, sans-serif; font-size: 17pt; line-height: 1; color: var(--qsh-acc); }
.qsh-tsub { font-size: 8.5pt; color: var(--qsh-mute); margin-top: .8mm; }
.qsh-tbox {
	position: relative;
	width: 42mm;
	height: 14mm;
	border: .8mm solid var(--qsh-frame);
	border-radius: 1.5mm;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
}
.qsh-tbox .qsh-pts-max { font-size: 9pt; }
.qsh-tbox .qsh-pts-val { font-size: 16pt; }
.qsh-color .qsh-tbox, .qsh-color .qsh-sbox { box-shadow: inset 0 -1.2mm 0 #fdd018; }

/* ——— Impression ——— */

@media print {
	body.qsh-printing > *:not(.qsh-print-root) { display: none !important; }
	body.qsh-printing { margin: 0 !important; padding: 0 !important; background: #fff !important; }
	.qsh { padding: 0; background: none; overflow: visible; }
	.qsh-page {
		zoom: 1;
		width: var(--qsh-w);
		height: var(--qsh-h);
		padding: 0;
		margin: 0;
		box-shadow: none;
		break-after: page;
		page-break-after: always;
	}
	.qsh-page:last-child { break-after: auto; page-break-after: auto; }
	.qsh-page.qsh-flow { height: auto; min-height: 0; }
	.qsh-flow .qsh-frame, .qsh-flow .qsh-block { break-inside: avoid; page-break-inside: avoid; }
	.qsh-flow .qsh-foot { display: none; }
}
