/* ========== SKIP LINK (RGAA) ========== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #000;
  color: #fff;
  padding: 8px 16px;
  z-index: 9999;
  font-family: 'Metamorphous', serif;
  text-decoration: none;
  font-size: 14px;
}
.skip-link:focus {
  top: 0;
}

/* ========== BASE ========== */
html, body {
  font-family: 'Metamorphous', serif;
  height: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  background-color: #000;
}

h1, h3, h4 {
  color: white;
  text-shadow: 2px 6px 4px rgba(0, 0, 0, 1);
}

h1 { font-size: 60px; margin: 0; }
h3 { font-size: 65px; margin: 0; }
h4 { font-size: 30px; margin: 0; }

p {
  color: white;
  font-size: 16px;
  line-height: 1.5;
}

/* ========== HEADER ========== */
.header {
  position: relative;
  width: 100%;
  height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: visible;
  z-index: 100;
  margin-bottom: -80px;
}

.header-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 110%;
  object-fit: cover;
  z-index: 1;
}

.header-top {
  position: absolute;
  top: 10px;
  width: 100%;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 5;
  box-sizing: border-box;
}

.logo img { height: 180px; width: auto; }

/* ========== NAVIGATION ========== */
.nav { display: flex; overflow: hidden; align-items: center; }

.nav a {
  display: inline-flex;
  align-items: center;
}

.nav img {
  padding: 0 20px 0 0;
  height: 90px;
  width: auto;
}

.nav img:hover { animation: vibrate 0.25s linear; }
.nav a:focus img { outline: 3px solid #fff; outline-offset: 2px; }

@keyframes vibrate {
  0%   { transform: translate(0); }
  20%  { transform: translate(-2px, 2px); }
  40%  { transform: translate(-2px, -2px); }
  60%  { transform: translate(2px, 2px); }
  80%  { transform: translate(2px, -2px); }
  100% { transform: translate(0); }
}

.title {
  position: relative;
  z-index: 10;
  font-size: 60px;
}

/* ========== SLIDESHOW BACKGROUND ========== */
.mainboard {
  margin: 0;
  z-index: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 500px;
  width: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  animation: slideshow 30s infinite;
}

@keyframes slideshow {
  0%, 33%   { background-image: url('./image/main1.jpg'); }
  33.1%, 66% { background-image: url('./image/main2.jpeg'); }
  66.1%, 100% { background-image: url('./image/main3.jpg'); }
}

/* ========== TEXTE ROTATIF ========== */
.mainboard-text {
  text-align: center;
  color: white;
  font-size: 65px;
  font-family: 'Metamorphous', serif;
  text-shadow: 2px 6px 4px rgba(0, 0, 0, 1);
  margin: 0;
  animation: h3text 30s infinite;
}

@keyframes h3text {
  0%, 33%   { opacity: 1; }
  33.1%, 66% { opacity: 1; }
  66.1%, 100% { opacity: 1; }
}

/* Hack CSS pour changer le texte via ::after */
.mainboard-text {
  font-size: 0; /* cache le contenu HTML */
}

.mainboard-text::after {
  content: "COMPARER";
  font-size: 65px;
  animation: h3text-content 30s infinite;
  display: block;
}

@keyframes h3text-content {
  0%, 33%   { content: "COMPARER"; }
  33.1%, 66% { content: "PROGRESSER"; }
  66.1%, 100% { content: "JOUER"; }
}

/* ========== BOARD ========== */
.board {
  position: relative;
  z-index: 50;
  background-image: url('./image/sousboard2.png');
  background-size: 100% auto;
  background-repeat: no-repeat;
  background-position: top center;
  background-color: #1a0e06; /* bois sombre - comble si le contenu dépasse l'image */
}

/* On cache l'img tag - le fond est géré en background-image */
.board > img.board-bg {
  display: none;
}

/* ========== FOOTER ========== */
.footer {
  position: relative;
  width: 100%;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.footer-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('./image/taf2.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 1;
}

.footer-content {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 40px 20px;
}

.footer-links a {
  display: block;
  font-size: 22px;
  color: white;
  text-decoration: none;
  padding: 4px;
}

.footer-links a:hover,
.footer-links a:focus {
  background-color: rgba(142,142,142,0.45);
  border-radius: 6px;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.footer-email {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.footer-email img { height: 28px; }
.footer-email a {
  font-size: 20px;
  color: white;
  text-decoration: none;
}
.footer-email a:hover,
.footer-email a:focus {
  text-decoration: underline;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ========== RESPONSIVE ========== */
@media (prefers-reduced-motion: reduce) {
  .mainboard { animation: none; background-image: url('./image/main1.jpg'); }
  .mainboard-text::after { animation: none; content: "COMPARER"; }
  .nav img:hover { animation: none; }
}

@media (max-width: 1024px) {
  .header { height: 240px; margin-bottom: -60px; }
  .logo img { height: 90px; }
  .nav img { height: 70px; }
  .title { font-size: 34px; }
  .mainboard { min-height: 100vh; }
  h3, .mainboard-text::after { font-size: 32px; }
}

@media (max-width: 600px) {
  .header { height: 200px; margin-bottom: -50px; }
  .logo img { height: 70px; }
  .nav img { height: 50px; }
  .title { font-size: 28px; }
  .footer { min-height: 380px; }
  .footer-email a { font-size: 16px; }
  .mainboard { min-height: 100vh; }
  h3, .mainboard-text::after { font-size: 24px; }
}
