:root {
  --pointer-x: 50%;
  --pointer-y: 50%;
  --pointer-from-center: 0;
  --pointer-from-top: 0.5;
  --pointer-from-left: 0.5;
  --card-opacity: 0;
  --rotate-x: 0deg;
  --rotate-y: 0deg;
  --background-x: 50%;
  --background-y: 50%;
  --grain: none;
  --icon: none;
  --behind-gradient: none;
  --inner-gradient: none;
  --sunpillar-1: hsl(2, 100%, 73%);
  --sunpillar-2: hsl(53, 100%, 69%);
  --sunpillar-3: hsl(93, 100%, 69%);
  --sunpillar-4: hsl(176, 100%, 76%);
  --sunpillar-5: hsl(228, 100%, 74%);
  --sunpillar-6: hsl(283, 100%, 73%);
  --sunpillar-clr-1: var(--sunpillar-1);
  --sunpillar-clr-2: var(--sunpillar-2);
  --sunpillar-clr-3: var(--sunpillar-3);
  --sunpillar-clr-4: var(--sunpillar-4);
  --sunpillar-clr-5: var(--sunpillar-5);
  --sunpillar-clr-6: var(--sunpillar-6);
  --card-radius: 30px;
}

.pc-card-wrapper {
  perspective: 500px;
  transform: translate3d(0, 0, 0.1px);
  position: relative;
  touch-action: none;
}


.pc-card {
  height: 80svh;
  max-height: 540px;
  display: grid;
  aspect-ratio: 0.718;
  border-radius: var(--card-radius);
  position: relative;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, #eee, transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 90px 40px, #fff, transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent),
    radial-gradient(2px 2px at 160px 30px, #fff, transparent),
    radial-gradient(1px 1px at 200px 100px, rgba(255,255,255,0.4), transparent),
    radial-gradient(2px 2px at 250px 50px, #eee, transparent),
    radial-gradient(1px 1px at 300px 120px, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 350px 80px, rgba(255,255,255,0.5), transparent),
    radial-gradient(2px 2px at 400px 40px, #fff, transparent),
    radial-gradient(1px 1px at 50px 150px, rgba(255,255,255,0.9), transparent),
    radial-gradient(2px 2px at 120px 200px, #eee, transparent),
    radial-gradient(1px 1px at 180px 50px, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 220px 180px, rgba(255,255,255,0.6), transparent),
    radial-gradient(2px 2px at 280px 90px, #fff, transparent),
    radial-gradient(1px 1px at 320px 220px, rgba(255,255,255,0.5), transparent),
    radial-gradient(2px 2px at 380px 60px, #eee, transparent),
    radial-gradient(1px 1px at 420px 190px, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 460px 110px, rgba(255,255,255,0.4), transparent),
    radial-gradient(2px 2px at 80px 250px, #fff, transparent),
    radial-gradient(1px 1px at 140px 30px, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 240px 160px, rgba(255,255,255,0.6), transparent),
    radial-gradient(2px 2px at 340px 40px, #eee, transparent),
    radial-gradient(1px 1px at 440px 170px, rgba(255,255,255,0.9), transparent);
  background-repeat: repeat;
  background-size: 500px 300px;
  animation: stars-move 20s linear infinite;
  /* Optimisations de performance légères */
  will-change: transform, filter;
  transform: translate3d(0, 0, 0);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.12);
  transition: transform 0.6s ease, box-shadow 0.3s ease;
  transform: translate3d(0, 0, 0.1px) rotateX(0deg) rotateY(0deg);
  overflow: hidden;
}

.pc-card:hover,
.pc-card.active {
  transition: none;
  transform: translate3d(0, 0, 0.1px) rotateX(var(--rotate-y)) rotateY(var(--rotate-x));
  box-shadow: 0 18px 70px rgba(0,0,0,0.9), 0 0 0 1px rgba(255,255,255,0.14);
}

.pc-card * {
  display: grid;
  grid-area: 1/-1;
  border-radius: var(--card-radius);
  transform: translate3d(0, 0, 0.1px);
  pointer-events: none;
}

.pc-inside {
  inset: 1px;
  position: absolute;
  background: rgba(0, 0, 0, 0.2);
  transform: translate3d(0, 0, 0.01px);
}



.pc-avatar-content {
  mix-blend-mode: normal;
  overflow: hidden;
  isolation: isolate;
  position: relative;
  z-index: 15;
}

.pc-avatar-content .avatar {
  width: 100%;
  position: absolute;
  left: 50%;
  transform: translateX(-50%) scale(1);
  bottom: 2px;
  opacity: calc(1.75 - var(--pointer-from-center));
  filter: none !important;
  mix-blend-mode: normal !important;
  isolation: isolate;
  z-index: 10;
  background: none;
  /* Protection complète contre tous les effets */
  backdrop-filter: none !important;
  background-blend-mode: normal !important;
  color-scheme: normal !important;
}

.pc-avatar-content::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  backdrop-filter: blur(38px);
  mask: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.2) 0%,
    rgba(0, 0, 0, 0.35) 55%,
    rgba(0, 0, 0, 0.98) 86%,
    rgba(0, 0, 0, 1) 100%
  );
  pointer-events: none;
  mix-blend-mode: normal;
}

.pc-user-info {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 12px 14px;
  pointer-events: auto;
  transition: opacity 0.3s ease;
}

.pc-user-info:hover {
  opacity: 1;
  z-index: 10;
}

.pc-user-details {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pc-mini-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.pc-mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.pc-user-text {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 6px;
}

.pc-handle {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1;
}

.pc-status {
  font-size: 14px;
  color: #4ade80;
  line-height: 1;
}

.pc-contact-btn {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  text-decoration: none;
  display: inline-block;
  pointer-events: auto !important;
  position: relative;
  z-index: 20;
}

.pc-contact-btn:hover {
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-1px);
  transition: all 0.2s ease;
  color: rgba(255, 255, 255, 1);
}

.pc-content {
  max-height: 100%;
  overflow: hidden;
  text-align: center;
  position: relative;
  transform: translate3d(
    calc(var(--pointer-from-left) * -6px + 3px),
    calc(var(--pointer-from-top) * -6px + 3px),
    0.1px
  ) !important;
  z-index: 5;
  mix-blend-mode: normal;
}

.pc-details {
  width: 100%;
  position: absolute;
  top: 3em;
  display: flex;
  flex-direction: column;
}

.pc-details h3 {
  font-weight: 600;
  margin: 0;
  font-size: min(5svh, 3em);
  margin: 0;
  background-image: linear-gradient(to bottom, #fff, #6f6fbe);
  background-size: 1em 1.5em;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
}

.pc-details p {
  font-weight: 600;
  position: relative;
  top: -12px;
  white-space: nowrap;
  font-size: 16px;
  margin: 0 auto;
  width: min-content;
  background-image: linear-gradient(to bottom, #fff, #4a4ac0);
  background-size: 1em 1.5em;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
}


@media (max-width: 768px) {
  .pc-card {
    height: 70svh;
    max-height: 450px;
  }

  .pc-details {
    top: 2em;
  }

  .pc-details h3 {
    font-size: min(4svh, 2.5em);
  }

  .pc-details p {
    font-size: 14px;
  }

  .pc-user-info {
    bottom: 15px;
    left: 15px;
    right: 15px;
    padding: 10px 12px;
  }

  .pc-mini-avatar {
    width: 28px;
    height: 28px;
  }

  .pc-user-details {
    gap: 10px;
  }

  .pc-handle {
    font-size: 13px;
  }

  .pc-status {
    font-size: 10px;
  }

  .pc-contact-btn {
    padding: 6px 12px;
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .pc-card {
    height: 60svh;
    max-height: 380px;
  }

  .pc-details {
    top: 1.5em;
  }

  .pc-details h3 {
    font-size: min(3.5svh, 2em);
  }

  .pc-details p {
    font-size: 12px;
    top: -8px;
  }

  .pc-user-info {
    bottom: 12px;
    left: 12px;
    right: 12px;
    padding: 8px 10px;
    border-radius: 50px;
  }

  .pc-mini-avatar {
    width: 24px;
    height: 24px;
  }

  .pc-user-details {
    gap: 8px;
  }

  .pc-handle {
    font-size: 12px;
  }

  .pc-status {
    font-size: 9px;
  }

  .pc-contact-btn {
    padding: 5px 10px;
    font-size: 10px;
    border-radius: 50px;
  }
}

@media (max-width: 320px) {
  .pc-card {
    height: 55svh;
    max-height: 320px;
  }

  .pc-details h3 {
    font-size: min(3svh, 1.5em);
  }

  .pc-details p {
    font-size: 11px;
  }

  .pc-user-info {
    padding: 6px 8px;
    border-radius: 50px;
  }

  .pc-mini-avatar {
    width: 20px;
    height: 20px;
  }

  .pc-user-details {
    gap: 6px;
  }

  .pc-handle {
    font-size: 11px;
  }

  .pc-status {
    font-size: 8px;
  }

  .pc-contact-btn {
    padding: 4px 8px;
    font-size: 9px;
    border-radius: 50px;
  }
}

/* Optimisations de performance */
@media (prefers-reduced-motion: reduce) {
  .pc-card {
    animation: none !important;
  }
  
  .pc-card * {
    animation: none !important;
  }
}

/* Optimisation pour appareils moins puissants */
@media (max-width: 768px) and (max-height: 600px) {
  .pc-card {
    animation: glow-bg 12s linear infinite;
  }
  
  .pc-shine {
    animation: none;
  }
}

/* Galaxy animation */
@keyframes stars-move {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 100% 100%;
  }
}
