/* Tir des 3 Tours, page principale
   Charte du site principal www.pcfribourg.ch : rouge du club, crème, bleu acier,
   titres en Montserrat, texte en Open Sans. */

/* Polices auto-hébergées sur pcfribourg.ch (CSP font-src 'self') */
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/montserrat-v31-latin_latin-ext-600.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/montserrat-v31-latin_latin-ext-700.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 800; font-display: swap; src: url("/assets/fonts/montserrat-v31-latin_latin-ext-800.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/open-sans-v44-latin_latin-ext-regular.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/open-sans-v44-latin_latin-ext-600.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/open-sans-v44-latin_latin-ext-700.woff2") format("woff2"); }

:root {
	--bordeaux: #c84245;          /* rouge du club (--accent du site principal) */
	--bordeaux-fonce: #9d2f32;
	--bordeaux-clair: #fbeeee;
	--rouge-texte: #9d2f32;       /* rouge pour du petit texte, contraste suffisant */
	--rouge-vif: #c84245;         /* rouge pour les grands chiffres */
	--fond: #fbf7f3;              /* crème */
	--fond-alt: #f6efe8;
	--surface: #ffffff;
	--texte: #3f3533;
	--titre: #2f2725;
	--texte-doux: #6e6763;
	--bord: #eadfd6;
	--libre: #1f7a4d;
	--libre-fond: #e8f5ee;
	/* Boutons principaux : bleu acier du site principal */
	/* Dégradé du site principal, foncé juste assez pour un texte blanc lisible (contraste >= 4.5:1) */
	--acier: linear-gradient(135deg, #3f6278 0%, #567a8e 100%);
	--acier-survol: linear-gradient(135deg, #34546a 0%, #4a6d82 100%);
	--acier-bord: #5b88a1;
	--acier-bord-survol: #42657b;
	--acier-ombre: 0 10px 22px rgba(54, 84, 102, .18);
	--acier-focus: rgba(77, 115, 138, .45);
	/* Illustration du tireur couché (cibles attribuées) */
	--tireur-veste: var(--bordeaux);
	--tireur-veste-ombre: #8a2629;
	--tireur-sombre: #2f2725;
	--tireur-acier: #5a5150;
	--tireur-bois: #9a6236;
	--tireur-peau: #e3b48d;
	--tireur-tapis: rgba(72, 42, 30, .14);
	--tireur-reflet: #ffffff;
	--rayon: 24px;
	--rayon-petit: 14px;
	--ombre: 0 18px 36px rgba(72, 42, 30, .07);

	/* Typographie fluide : grandit doucement entre 320 px et 1280 px de large */
	--fs-0: clamp(.8125rem, .78rem + .15vw, .875rem);
	--fs-1: clamp(1rem, .96rem + .2vw, 1.0625rem);
	--fs-2: clamp(1.125rem, 1.05rem + .4vw, 1.375rem);
	--fs-3: clamp(1.375rem, 1.2rem + .9vw, 2rem);
	--police: "Open Sans", Arial, sans-serif;
	--police-titre: "Montserrat", Arial, sans-serif;
	color-scheme: light;
}

/* Mode sombre : le site principal n'en a pas, on garde le nôtre en l'harmonisant
   (fonds brun très foncé, rouge éclairci pour le texte). */
@media (prefers-color-scheme: dark) {
	:root {
		--bordeaux-clair: #3a1f1e;
		--rouge-texte: #f09497;
		--rouge-vif: #f09497;
		--fond: #16110f;
		--fond-alt: #1c1513;
		--surface: #221a18;
		--texte: #f3ece7;
		--titre: #faf4ef;
		--texte-doux: #bdb2ab;
		--bord: #3d322e;
		--libre: #5fd39a;
		--libre-fond: #15291f;
		--acier-ombre: none;
		--acier-focus: rgba(130, 172, 197, .55);
		--tireur-veste: #df6265;
		--tireur-veste-ombre: #a3383b;
		--tireur-sombre: #c2b6b0;
		--tireur-acier: #dcd2cc;
		--tireur-bois: #c98a55;
		--tireur-peau: #e8bf9c;
		--tireur-tapis: rgba(255, 255, 255, .16);
		--tireur-reflet: #221a18;
		--ombre: none;
		color-scheme: dark;
	}
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
	margin: 0;
	font-family: var(--police);
	font-size: var(--fs-1);
	line-height: 1.6;
	color: var(--texte);
	background: var(--fond);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; }

a { color: inherit; }

h1, h2, h3 {
	line-height: 1.2;
	margin: 0;
	font-family: var(--police-titre);
	font-weight: 700;
	color: var(--titre);
}

.visuellement-cache {
	position: absolute; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap;
}

/* En-tête : blanc comme le site principal, liseré rouge du club */
.entete {
	background: var(--surface);
	color: var(--texte);
	padding: 16px;
	border-top: 5px solid var(--bordeaux);
	border-bottom: 1px solid var(--bord);
	box-shadow: 0 10px 24px rgba(72, 42, 30, .05);
}
.entete-inner {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 12px 16px;
	flex-wrap: wrap;
}
.entete-logo { height: clamp(44px, 8vw, 72px); width: auto; background: #fff; border-radius: 12px; padding: 4px; }
.entete-texte { flex: 1 1 240px; min-width: 0; }
.entete h1 { font-size: var(--fs-3); font-weight: 800; letter-spacing: -.01em; }
.entete p { margin: 4px 0 0; font-size: var(--fs-0); color: var(--texte-doux); overflow-wrap: anywhere; }
.entete a { color: var(--rouge-texte); }
.entete .entete-langue {
	font-family: var(--police-titre);
	font-size: var(--fs-0);
	font-weight: 700;
	letter-spacing: .04em;
	text-decoration: none;
	color: var(--texte);
	border: 1px solid var(--bord);
	border-radius: 999px;
	padding: 8px 16px;
	min-height: 40px;
	display: inline-flex;
	align-items: center;
	transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.entete .entete-langue:hover { background: var(--bordeaux-clair); border-color: var(--bordeaux); color: var(--rouge-texte); }

/* Contenu */
.contenu {
	max-width: 1200px;
	margin: 0 auto;
	padding: 16px;
	display: grid;
	gap: 16px;
}
@media (min-width: 760px) { .contenu { padding: 24px 16px; gap: 20px; } }
.bloc {
	background: var(--surface);
	border: 1px solid var(--bord);
	border-radius: clamp(16px, 2.5vw, var(--rayon));
	box-shadow: var(--ombre);
	padding: clamp(16px, 3vw, 28px);
	min-width: 0;
}
.bloc h2 { font-size: var(--fs-2); margin-bottom: 14px; }

/* Compteur général */
.compteur { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 4px 12px; }
.compteur-chiffre { font-family: var(--police-titre); font-weight: 600; font-size: var(--fs-2); color: var(--texte-doux); }
.compteur-chiffre strong { font-size: var(--fs-3); font-weight: 800; color: var(--rouge-vif); }
.compteur-texte { color: var(--texte-doux); }
.compteur .jauge { grid-column: 1 / -1; }

.jauge { display: block; height: 6px; border-radius: 3px; background: var(--fond-alt); overflow: hidden; }
.jauge > span { display: block; height: 100%; background: var(--bordeaux); border-radius: 3px; }
@media (prefers-color-scheme: dark) { .jauge { background: var(--bord); } }

/* Jours : défilement horizontal sur mobile, grille sur grand écran */
.jours {
	list-style: none;
	margin: 0 -16px;
	padding: 2px 16px 8px;
	display: flex;
	gap: 8px;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scrollbar-width: thin;
}
.jours li { flex: 0 0 auto; scroll-snap-align: start; }
@media (min-width: 760px) {
	.jours {
		margin: 0;
		padding: 0;
		overflow: visible;
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
	}
}
.jour {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 118px;
	padding: 10px 14px;
	border: 1px solid var(--bord);
	border-radius: var(--rayon-petit);
	text-decoration: none;
	background: var(--fond);
	transition: border-color .2s ease, transform .2s ease;
}
.jour:hover { border-color: var(--bordeaux); }
.jour-date { font-family: var(--police-titre); font-weight: 700; white-space: nowrap; color: var(--titre); }
.jour-places { font-size: var(--fs-0); color: var(--texte-doux); }
.jour.est-actif { background: var(--bordeaux); border-color: var(--bordeaux); color: #fff; box-shadow: 0 10px 20px rgba(157, 47, 50, .18); }
.jour.est-actif .jour-date { color: #fff; }
.jour.est-actif .jour-places { color: rgba(255, 255, 255, .92); }
.jour.est-actif .jauge { background: rgba(255, 255, 255, .3); }
.jour.est-actif .jauge > span { background: #fff; }
.jour.est-complet:not(.est-actif) { opacity: .6; }
@media (prefers-color-scheme: dark) { .jour.est-actif { box-shadow: none; } }

/* Légende */
.legende {
	list-style: none; margin: 0 0 16px; padding: 0;
	display: flex; flex-wrap: wrap; gap: 6px 20px;
	font-size: var(--fs-0); color: var(--texte-doux);
}
.legende li { display: flex; align-items: center; gap: 8px; }
.pastille { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.pastille-libre { background: var(--libre-fond); border: 2px dashed var(--libre); }
.pastille-prise { background: var(--bordeaux-clair); border: 2px solid var(--bordeaux); }

/* Séries et cibles */
.serie + .serie { margin-top: 28px; }
.serie-titre {
	display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
	gap: 4px 12px; font-size: var(--fs-1); margin-bottom: 10px;
}
.serie-libres { font-family: var(--police); font-size: var(--fs-0); font-weight: 600; color: var(--libre); }
.serie-libres.est-complet { color: var(--texte-doux); }

.cibles {
	list-style: none; margin: 0; padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(66px, 1fr));
	gap: 6px;
}
@media (min-width: 480px) {
	.cibles { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
}
@media (min-width: 1100px) {
	/* Deux rangées de 9 cibles, comme le stand */
	.cibles { grid-template-columns: repeat(9, 1fr); }
}
.cible {
	position: relative;
	display: flex; flex-direction: column;
	border-radius: var(--rayon-petit);
	min-height: 104px;
	font-size: var(--fs-0);
	text-align: center;
	transition: transform .2s ease, box-shadow .2s ease;
}
.cible-lien {
	flex: 1;
	display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
	gap: 4px;
	padding: 10px 6px;
	border-radius: inherit;
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
}
.cible-lien:focus-visible { outline: 3px solid var(--acier-bord); outline-offset: 2px; }
.cible-num { font-family: var(--police-titre); font-size: var(--fs-2); font-weight: 800; line-height: 1; }
.cible-nom { overflow-wrap: anywhere; line-height: 1.25; }
.cible-action { margin-top: auto; font-weight: 600; }
.cible-icone { width: 100%; max-width: 108px; height: auto; display: none; margin: 2px 0; }
@media (min-width: 480px) {
	.cible { min-height: 128px; }
	.cible-icone { display: block; }
}
@media (hover: hover) {
	.cible.est-libre:hover, .cible.est-prise:hover { transform: translateY(-2px); box-shadow: var(--ombre); }
}
@media (prefers-reduced-motion: reduce) {
	.cible, .jour { transition: none; }
	.cible.est-libre:hover, .cible.est-prise:hover { transform: none; }
}

.cible.est-libre { background: var(--libre-fond); border: 2px dashed var(--libre); }
.cible.est-libre .cible-num, .cible.est-libre .cible-action { color: var(--libre); }
.cible.est-libre .cible-action {
	background: var(--libre); color: #fff; border-radius: 999px; padding: 4px 12px;
	font-family: var(--police-titre); font-weight: 700; letter-spacing: .02em;
}
@media (prefers-color-scheme: dark) { .cible.est-libre .cible-action { color: #0c1f15; } }
/* Petits écrans : la pastille « Réserver » occupe toute la largeur de la cible (étroite) */
@media (max-width: 479px) {
	.cible-lien { padding: 8px 3px; }
	.cible.est-libre .cible-action {
		align-self: stretch;
		padding: 4px 2px;
		border-radius: 10px;
		font-family: var(--police);
		font-size: .75rem;
		letter-spacing: 0;
		line-height: 1.2;
		-webkit-hyphens: auto;
		hyphens: auto;
		overflow-wrap: break-word;
	}
}
.cible.est-libre:hover { border-style: solid; }

.cible.est-prise { background: var(--bordeaux-clair); border: 2px solid var(--bordeaux); }
.cible.est-prise .cible-num { color: var(--rouge-texte); }
.cible.est-prise .cible-action { color: var(--rouge-texte); text-decoration: underline; text-underline-offset: 2px; }
.cible-resultat {
	display: block; padding: 6px; font-size: var(--fs-0);
	border-top: 1px solid rgba(200, 66, 69, .25); color: var(--texte-doux);
}
.cible-resultat:hover { color: var(--rouge-texte); }

.cible.est-reservee {
	background: var(--fond-alt); border: 2px solid var(--bord); color: var(--texte-doux);
	justify-content: center; gap: 6px; padding: 10px 6px;
}

/* Formulaire « section » */
.form-section { display: flex; flex-wrap: wrap; gap: 10px; }
.form-section select { flex: 1 1 260px; min-width: 0; }
select, .bouton {
	font: inherit;
	min-height: 48px;
}
select {
	padding: 8px 14px;
	border: 1px solid var(--bord);
	border-radius: var(--rayon-petit);
	background: var(--surface);
	color: var(--texte);
}
select:focus-visible { outline: 3px solid var(--acier-focus); outline-offset: 1px; border-color: var(--acier-bord); }

/* Bouton principal : bleu acier en dégradé, forme pilule (site principal) */
.bouton {
	padding: 10px 24px;
	border: 2px solid var(--acier-bord);
	border-radius: 999px;
	background: var(--acier);
	color: #fff;
	font-family: var(--police-titre);
	font-weight: 700;
	letter-spacing: .03em;
	text-shadow: 0 1px 1px rgba(32, 56, 72, .35);
	box-shadow: var(--acier-ombre);
	cursor: pointer;
	transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.bouton:hover { background: var(--acier-survol); border-color: var(--acier-bord-survol); transform: translateY(-1px); }
.bouton:focus-visible { outline: 3px solid var(--acier-focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .bouton:hover { transform: none; } }

/* Pied de page */
.pied {
	text-align: center; padding: 24px 16px 32px;
	font-size: var(--fs-0); color: var(--texte-doux);
}
.pied p { margin: 8px 0 0; }
.pied a { color: var(--rouge-texte); }

/* Panneau d'inscription : feuille montante sur mobile, fenêtre centrée sur ordinateur */
.panneau {
	padding: 0;
	border: 0;
	background: var(--surface);
	color: var(--texte);
	width: 100%;
	max-width: 100%;
	height: 92vh;
	height: 92dvh;
	max-height: none;
	margin: auto 0 0;
	border-radius: var(--rayon) var(--rayon) 0 0;
	box-shadow: 0 -12px 36px rgba(72, 42, 30, .22);
	overflow: hidden;
}
.panneau[open] { display: flex; flex-direction: column; animation: monter .25s ease-out; }
.panneau::backdrop { background: rgba(47, 39, 37, .55); }
@keyframes monter { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (min-width: 640px) {
	.panneau {
		width: min(560px, calc(100% - 32px));
		height: min(680px, calc(100dvh - 48px));
		margin: auto;
		border-radius: var(--rayon);
		box-shadow: 0 24px 60px rgba(72, 42, 30, .25);
	}
	.panneau-poignee { display: none; }
}
@media (prefers-reduced-motion: reduce) { .panneau[open] { animation: none; } }

.panneau-entete {
	position: relative;
	display: flex; align-items: center; gap: 12px;
	padding: 16px 12px 12px 22px;
	border-bottom: 1px solid var(--bord);
	background: var(--fond);
}
.panneau-poignee {
	position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
	width: 40px; height: 4px; border-radius: 2px; background: var(--bord);
}
.panneau-entete h2 { flex: 1; font-size: var(--fs-1); }
.panneau-fermer {
	flex: none;
	width: 44px; height: 44px;
	border: 1px solid var(--bord); border-radius: 50%;
	background: var(--surface); color: var(--texte);
	font-size: 26px; line-height: 1; cursor: pointer;
}
.panneau-fermer:hover { background: var(--bordeaux-clair); border-color: var(--bordeaux); color: var(--rouge-texte); }
.panneau-corps { flex: 1; position: relative; }
.panneau-corps iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--surface); }

/* Inscriptions closes ($mutations_ouvertes = false) : bandeau et cibles non cliquables */
.annonce-clos {
	margin: 0 0 16px;
	padding: 12px 16px;
	border-radius: 14px;
	border: 1px solid var(--bord);
	border-left: 5px solid var(--bordeaux);
	background: var(--bordeaux-clair);
	color: var(--titre, var(--texte));
	font-weight: 600;
}
.inscriptions-closes .cible-lien { cursor: default; }
.inscriptions-closes .cible.est-libre,
.inscriptions-closes .cible.est-libre:hover { border-style: dashed; }
.inscriptions-closes .cible.est-libre:hover,
.inscriptions-closes .cible.est-prise:hover { transform: none; box-shadow: none; }
