
:root{
    --case-size: 46px; /* <= pour 6 chiffres. Ou alors, --case-size: 56px; pour 5 chiffres. Voir plus bas .grid ajouté ŕ @media */
    --case-size-small: 34px; /* <= pour les opérateurs. Avant --case-size-small: 32px; */
    --accent: #2B7CFF;
    --used-bg: #E0E0E0;
}

*{box-sizing: border-box;
}

.app{
	max-width: 980px;
	margin: 0 auto;
}

/* pas utilisé
h1{margin:0 0 12px;font-size:22px;text-align:center}
h2{font-size:16px;margin:12px 0}
*/

.target{
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
}

.label{
	font-weight: 700;
	font-size: 16px;
}

.grid{
	display: flex;
	justify-content: center;
	gap: 8px;
	flex-wrap: wrap;
	padding: 6px 0 12px;
}

.case{
    background:#FFFFFF;
	border: 2px solid #333333;
	width: var(--case-size);
	height: var(--case-size);
    display: flex;
	justify-content: center;
	align-items: center;
	font-size: 18px;
	border-radius: 8px;
    cursor: pointer;
	user-select: none;
	box-shadow: 1px 1px 4px rgba(0,0,0,0.08);
}

.case.small{
	display: flex;
	justify-content: center;
	align-items: center;
	width: var(--case-size-small);
	height: var(--case-size-small);
	font-size: 16px;
	padding: 4px;
}

.cible{
	background: #FFEF8A;
	border-color: #C9A92B;
	font-weight: 800;
	font-size: 20px;
	/* width: 110px; height: 64px - taille original */
	width: 100px;
	height: 54px;
}

.number.used{
	background: var(--used-bg);
	border-color: #9E9E9E;
	color: #777777;
	opacity: 0.65;
	cursor: default;
}

.stack, #currentStack{
	max-width: 400px;
    min-height: 40px;
	background: #FFFFFF;
	border: 2px solid #DEDEDE;
	padding: 8px;
	border-radius: 8px;
/*	margin-top: 6px;
	margin: 8px auto;*/
	margin: 8px auto 16px;
    text-align: center;
	color: #111111;
	font-size: 15px;
}

.controls{
    display: flex;
    justify-content: center;  /* centre les boutons */
    gap: 20px;                 /* espace constant entre eux */
    margin-top: 10px;
    margin-bottom: 10px;
}

button{
	width: auto;
	height: auto;
    padding: 14px 12px;
	border-radius: 8px;
	border: 2px solid var(--accent);
	background: linear-gradient(#FFFFFF,#EEF6FF);
    cursor: pointer;
	font-weight: 600;
}

/* pour cacher le bouton "Aide" */
#hintBtn {
    display: none !important;
}

.output{
	margin-top: 12px;
	min-height: 36px;
	text-align: center;
	font-size: 15px;
	color: #222222;
}

/* résultats intermédiaires (historique) */
.results-section, .history-section{
	margin-top: 14px;
}

.history{
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 8px;
}

.result-case{
    background: #F0F8FF;
	border: 2px solid #9CC1FF;
	padding: 8px 10px;
	border-radius: 8px;
	cursor: pointer;
    min-width: 80px;
	text-align: center;
}

/* visual active/indice (hint) */
.case.active{
	outline: 3px solid rgba(43,124,255,0.16);
}

.case.active:hover,
.case.active:hover * {
    opacity: 1 !important;
    color: inherit !important;
    visibility: visible !important;
}

.case.hint{
	box-shadow: 0 0 0 4px rgba(43,124,255,0.12);
	transform: scale(1.04);
}

.case.result{
	background:#E8FFF7;
	border-color: #6FD2A6;
	width: auto;
	padding-left: 5px;
	padding-right: 5px;
}

/* mobile */
@media only screen and (max-width:700px){
	button {
	padding: 16px 12px;
  }
	.colonnemilieu {
	width: 99.9999%;
	margin-left: 0px;
	margin-right: 0px;
	padding-left: 0px;
	padding-right: 0px;
  }
	.app{
	flex-direction: column;
	gap: 10px;
	padding: 8px;
  }
    .cible{ /* original: width:96px;height:56px;font-size:18px - code pour changer teille du chiffre cible */
	width: 90px;
	height: 50px;
	font-size: 20px;
  }
    :root{ /* original: --case-size:48px;--case-size-small:28px - code pour la taille des cases chiffres disponibles et opérateurs */
	--case-size: 42px;
	--case-size-small: 30px;
  }
    .case{
	font-size:16px;
  }
	.grid{ /* code ajouté pour utiliser 6 chiffres - affichage des cases chiffres disponibles et résultats */
	margin-left: -10px;
	margin-right: -10px;
  }
}
