body{
	margin: 0;
	padding: 0;
	border: 0;
	box-sizing: border-box;
}

#conteneurGlobal {
	width: 100%;
	height: 100%;
	margin:0;
	box-sizing: border-box;
}

.board-wrapper {
	position: relative;
	margin: auto;
	display: inline-block;
}

.coords-game {
	display: grid;
	position: sticky;
	max-width: 800px;
}

.board-labels {
	display: none;
	position: absolute;
	font-family: 'Noto Sans', sans-serif;
	font-weight: 800;
	font-size: calc(var(--case-size, 12.5vw) * 0.11);
	color: rgba(255,255,255,0.7);
	pointer-events: none;
}

.show-coords .board-labels {
	display: flex;
}

.board-labels.files.bottom {
	flex-direction: row;
	left: 0; right: 0;
	bottom: 0;
	justify-content: space-around;
}

.board-labels.ranks.left {
	flex-direction: column;
	top: 0; bottom: 0;
	left: -1.8vw;
	justify-content: space-around;
}

.board-labels span {
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--case-size, 12.5vw);
}

.case {
	width: var(--case-size, 12.5vw);
	height: var(--case-size, 12.5vw);
	display: flex;
	border: 1pt;
	background-color: red;
	justify-content: center;
	align-items: center;
	font-size: 0;
}

.blanche {
	color: rgba(0,0,0,0);
	background-color: AntiqueWhite;
}

.noire {
	color: rgba(0,0,0,0);
	background-color: SandyBrown;
}

.trouvee {
}

@keyframes inactive {
	100% {filter: contrast(0.5);}
}

.inactive {
	animation-name: inactive;
	animation-duration: 1s;
	animation-delay: 1s;
	animation-iteration-count: 1;
}

.flex-container {
	display: flex;
	background-color: lightgray;
	flex-direction: column;
}

.echiquier {
	border-spacing: 0pt;
	margin: 0px;
}

.affichage_cible {
	position: absolute;
	z-index: 100;
	font-family: 'Noto Sans', sans-serif;
	font-weight: 800;
	font-size: 30vw;
	opacity: 0.5;
	pointer-events: none;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	color: gray;
}

.cible {
	font-family: 'Noto Sans', sans-serif;
	font-weight: 800;
	font-size: 2em;
	opacity: 1.0;
}

.prevent-select {
	-webkit-user-select: none; /* Safari */
	-ms-user-select: none; /* IE 10 and IE 11 */
	user-select: none; /* Standard syntax */
}

.valeur {
	display: inline-block;
}

/* The animation code */
@keyframes clignote {
	50% {
		background-color: red;
		color:gray;
	}
}

@keyframes tourne1_2 {
	00.0% {transform: rotate(0turn)     scale(1.000);}
	12.5% {transform: rotate(0.125turn) scale(0.707);}
	25.0% {transform: rotate(0.250turn) scale(1.000);}
	37.5% {transform: rotate(0.375turn) scale(0.707);}
	50.0% {transform: rotate(0.500turn) scale(1.000);}
	62.5% {transform: rotate(0.625turn) scale(0.707);}
	75.0% {transform: rotate(0.750turn) scale(1.000);}
	87.5% {transform: rotate(0.875turn) scale(0.707);}
       100.0% {transform: rotate(1.000turn) scale(1.000);}
}

@keyframes tourne1 {
	100% {transform: rotate(1turn);}
}

@keyframes tourne2 {
	100% {transform: rotate(2turn);}
}

.clignote {
	animation-name: clignote;
	animation-duration: 3s;
	animation-delay: 2s;
	animation-iteration-count: infinite;
}

.tourne1 {
	animation-name: tourne1;
	animation-duration: 1s;
	animation-delay: 0s;
	animation-iteration-count: 1;
}

.tourne1_2 {
	animation-name: tourne1_2;
	animation-duration: 10s;
	animation-delay: 0s;
	animation-timing-function: linear;
}

.tourne2 {
	animation-name: tourne2;
	animation-duration: 1s;
	animation-delay: 0s;
	animation-iteration-count: 1;
}

.vision_haute {
  width: 100%;
  padding: 0;
  font-size: 2em;
  text-align:center;
  color: #fff;
  background: #1C7CCC;
  cursor: pointer;
  display: flex;
}

.vision_haute>div {
	margin: auto;
}

.vision_haute>button:last-child {
	margin-right: auto;
}

.mode-selector {
	display: flex;
	gap: 6px;
	align-items: center;
}

.mode-btn {
	padding: 6px 14px;
	font-size: 0.7em;
	font-family: 'Orbitron', sans-serif;
	letter-spacing: 0.05em;
	background: rgba(255,255,255,0.1);
	color: rgba(255,255,255,0.6);
	border: 1px solid rgba(255,255,255,0.2);
	border-radius: 20px;
	cursor: pointer;
	transition: all 0.2s ease;
	white-space: nowrap;
}

.mode-btn:hover {
	background: rgba(255,255,255,0.2);
	color: white;
	border-color: rgba(255,255,255,0.5);
}

.mode-btn.active {
	background: #1C7CCC;
	color: white;
	border-color: #1C7CCC;
	box-shadow: 0 0 10px rgba(28,124,204,0.6);
}

@keyframes surprise {
	0% {filter: hue-rotate(90deg);}
	100% {filter: hue-rotate(360deg);}
}

.surprise {
	animation-name: surprise;
	animation-delay: 1s;
	animation-duration: 6s;
	animation-iteration-count: 6;
}

/* Leaderboard */
.leaderboard {
  position: fixed;
  right: 16px;
  top: 0;
  width: 220px;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.12);
  border-top: none;
  color: white;
  padding: 16px 16px 0;
  border-radius: 0 0 12px 12px;
  font-family: 'Source Sans Pro', sans-serif;
  z-index: 10;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.leaderboard.lb-collapsed {
  transform: translateY(calc(-100% + 34px));
}
.lb-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 7px 4px;
  font-size: 0.78em;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.5px;
  user-select: none;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 12px;
}
.lb-tab:hover { color: rgba(255,255,255,0.8); }
.lb-chevron {
  transition: transform 0.4s;
  font-size: 0.75em;
  opacity: 0.7;
}
.leaderboard.lb-collapsed .lb-chevron {
  transform: rotate(180deg);
}
.leaderboard h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.95em;
  margin-bottom: 12px;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.lb-mode-tag {
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 0.85em;
  letter-spacing: 0;
  text-transform: capitalize;
}
.lb-section {
  margin-bottom: 14px;
}
.lb-section-title {
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 6px;
}
.lb-alltime {
  font-size: 0.92em;
  font-weight: 600;
  color: #ffd700;
  padding: 6px 8px;
  background: rgba(255,215,0,0.08);
  border-radius: 6px;
  border-left: 3px solid #ffd700;
}
.leaderboard ol {
  list-style: none;
  padding: 0;
  margin: 0;
}
.leaderboard li {
  font-size: 0.88em;
  margin: 4px 0;
}
.lb-loading {
  color: rgba(255,255,255,0.4);
  font-style: italic;
}
.lb-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
}
.lb-medal {
  font-size: 1.1em;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.lb-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-time {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.78em;
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
}
.lb-footer {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}
.lb-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 0.82em;
  cursor: pointer;
  transition: background 0.15s;
}
.lb-btn:hover {
  background: rgba(255,255,255,0.18);
}
.lb-status {
  margin-top: 8px;
  text-align: center;
  color: rgba(255,255,255,0.7);
  font-size: 0.8em;
  min-height: 1.2em;
}

/* Punch overlay */
@keyframes punch {
	0%   { transform: translate(-50%, -50%) scale(0.05); opacity: 0; }
	20%  { transform: translate(-50%, -50%) scale(1.0);  opacity: 1; }
	60%  { transform: translate(-50%, -50%) scale(1.0);  opacity: 1; }
	100% { transform: translate(-50%, -50%) scale(2.5);  opacity: 0; }
}

.punch-overlay {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	pointer-events: none;
	z-index: 300;
	font-family: 'Orbitron', sans-serif;
	font-weight: 800;
	font-size: 8vw;
	color: white;
	text-shadow: 0 0 40px rgba(0,0,0,0.9), 0 0 80px rgba(28,124,204,0.6);
	text-align: center;
	white-space: pre;
	opacity: 0;
}

.punch-overlay.playing {
	animation: punch 1.5s ease-out forwards;
}

/* Name modal */
.name-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6,10,178,0.88);
  z-index: 200;
  justify-content: center;
  align-items: center;
}
.name-modal.open {
  display: flex;
}
.name-panel {
  background: linear-gradient(135deg, #1C7CCC, #0e4f8a);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 16px;
  padding: 36px 40px 32px;
  text-align: center;
  color: white;
  width: 320px;
  max-width: 90vw;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.name-trophy {
  font-size: 3em;
  margin-bottom: 8px;
}
.name-panel h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.3em;
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.name-subtitle {
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 0.92em;
  color: rgba(255,255,255,0.75);
  margin-bottom: 20px;
}
.name-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 1em;
  font-family: 'Source Sans Pro', sans-serif;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
  color: white;
  outline: none;
  transition: border-color 0.15s;
  margin-bottom: 20px;
  box-sizing: border-box;
}
.name-input::placeholder { color: rgba(255,255,255,0.4); }
.name-input:focus { border-color: rgba(255,255,255,0.7); }
.name-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.name-btn-skip {
  padding: 10px 22px;
  font-size: 0.95em;
  font-family: 'Source Sans Pro', sans-serif;
  background: transparent;
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.name-btn-skip:hover { color: white; border-color: rgba(255,255,255,0.6); }
.name-btn-ok {
  padding: 10px 28px;
  font-size: 0.95em;
  font-family: 'Orbitron', sans-serif;
  background: #060AB2;
  color: white;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.name-btn-ok:hover { background: white; color: #060AB2; border-color: white; }
