/* RESET & BASE */
body {
  margin: 0;
  font-family: sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: url("https://images.unsplash.com/photo-1499002238440-d264edd596ec?auto=format&fit=crop&w=1470&q=80")
    no-repeat center / cover;
  overflow: hidden;
}

/* TITRE */
h2 {
  text-transform: uppercase;
  letter-spacing: 4px;
  font-size: clamp(12px, 3vw, 16px);
  text-align: center;
  color: white;
  margin-bottom: 20px;
}

/* CONTENEUR PRINCIPAL */
.clock {
  display: flex;
  flex-wrap: wrap;               /* 🔑 responsive */
  justify-content: center;
  gap: 12px;
}

/* CHAQUE BLOC (heure, minute, seconde, am/pm) */
.clock div {
  display: flex;
  flex-direction: column;        /* empilement vertical */
  align-items: center;
  position: relative;
}

/* CHIFFRES */
.clock span {
  width: clamp(70px, 20vw, 100px);
  height: clamp(60px, 18vw, 80px);
  background: slateblue;
  opacity: 0.85;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: clamp(28px, 8vw, 50px);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  border-radius: 6px;
}

/* TEXTE (Heure, Minute, Seconde) */
.clock .text {
  margin-top: 4px;
  width: 100%;
  height: 28px;
  font-size: clamp(8px, 2.5vw, 10px);
  text-transform: uppercase;
  letter-spacing: 2px;
  background: darkblue;
  opacity: 0.8;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 4px;
}

/* AM / PM — placé SOUS les secondes */
.clock #ampm {
  margin-top: 10px;              /* 🔑 espace avec les secondes */
  width: 70px;
  height: 32px;
  font-size: clamp(14px, 4vw, 20px);
  background: green;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 4px;
}

/* 📱 TELEPHONE */
@media (max-width: 480px) {
  .clock {
    gap: 8px;
  }

  h2 {
    letter-spacing: 2px;
  }
}

/* 📱 TABLETTE */
@media (max-width: 768px) {
  .clock {
    gap: 10px;
  }
}
