:root {
  color-scheme: dark;
  --fond: #0f1220;
  --texte: #f4f4f8;
  --sourdine: #9a9dbd;
  --carte: #1a1e33;
  --carte-bord: rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  background: var(--fond);
  color: var(--texte);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
  touch-action: manipulation;
}

.scene {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: max(28px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
}

/* Relief en fond : trois taches de couleur qui dérivent lentement, jamais
   un aplat statique. */
.fond {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.tache {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  will-change: transform;
}
.tache-1 {
  width: 60vw; height: 60vw;
  background: #ff7a1a;
  top: -20vw; left: -15vw;
  animation: deriver-1 22s ease-in-out infinite;
}
.tache-2 {
  width: 50vw; height: 50vw;
  background: #5b6bff;
  bottom: -20vw; right: -10vw;
  animation: deriver-2 26s ease-in-out infinite;
}
.tache-3 {
  width: 40vw; height: 40vw;
  background: #12c48b;
  top: 40vh; left: 55vw;
  animation: deriver-3 30s ease-in-out infinite;
}
@keyframes deriver-1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(6vw, 8vw); }
}
@keyframes deriver-2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-8vw, -6vw); }
}
@keyframes deriver-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-4vw, 5vw) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .tache { animation: none; }
}

.entete {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-bottom: 32px;
}
.entete h1 {
  margin: 0;
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.sous-titre {
  margin: 6px 0 0;
  color: var(--sourdine);
  font-size: 0.95rem;
}

.grille {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.carte {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 20px 18px;
  min-height: 140px;
  border-radius: 20px;
  border: 1px solid var(--carte-bord);
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 22%, var(--carte)) 0%, var(--carte) 60%);
  color: var(--texte);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transform: translateY(0);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.carte:active {
  transform: translateY(2px) scale(0.98);
  box-shadow: 0 4px 14px -8px rgba(0, 0, 0, 0.6);
}
@media (hover: hover) {
  .carte:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px -14px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }
}

.pastille {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  background: var(--accent);
  color: #10121d;
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 70%, transparent);
}

.nom {
  font-size: 1.05rem;
  font-weight: 600;
}

.description {
  font-size: 0.82rem;
  color: var(--sourdine);
  line-height: 1.3;
}

.vide {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--sourdine);
  margin-top: 40px;
}
