:root {
  --film-orange: hsl(25,95%,55%);
  --film-orange-glow: hsl(25,90%,65%);
  --film-green: hsl(160,40%,40%);
  --film-surface: hsl(220,18%,15%);
  --film-dark: hsl(220,20%,8%);
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--film-dark);
  color: hsl(40,20%,92%);
  margin: 0;
}

h1,h2,h3,h4 {
  font-family: 'Libre Baskerville', serif;
}

.text-gradient-accent {
  background: linear-gradient(135deg, var(--film-orange), hsl(35,90%,60%));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-thumb {
  background-color: var(--film-orange);
  border-radius: 3px;
}

@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(20px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.favorite-poster {
  animation: fadeInUp 0.8s ease forwards;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.favorite-poster:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 25px -5px hsl(25,95%,55% / 0.6);
}

@media (max-width: 640px) {
  #favorites {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .favorite-poster {
    width: 100%;
  }

  #correctMovie {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    max-width: 90%;
    margin: 0 auto 1rem auto;
  }

  #correctMovie .card {
    width: 100%;
    max-width: 220px;
  }
}

@media (min-width: 641px) {
  #placeholderPoster {
    display: none;
  }
}

.card-wrapper {
  perspective: 1000px;
}

.flip-card {
  position: relative;
  width: 100%;
  aspect-ratio: 2/3;
  transform-style: preserve-3d;
  transition: transform 0.6s;
  cursor: pointer;
}

.flip-card.flipped {
  transform: rotateY(180deg);
}

.flip-front, .flip-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 0.75rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.flip-back {
  transform: rotateY(180deg);
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.flip-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.movie-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#posterToggle:checked + span {
  background-color: hsl(25, 36%, 49%);
}

#posterToggle:checked + span + #toggleThumb {
  transform: translateX(100%);
}

#toggleThumb {
  transition: transform 0.3s ease;
}