html {
  scroll-behavior: smooth;
}

html,
body {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  background-color: var(--color-5);
  overflow-x: hidden;
  opacity: 0;
  animation: fadeIn 1.4s ease-out forwards;
  cursor: url("media/images/magic-wand.ico") 10 10, auto !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fonts */
.set-text-font {
  font-family: "Delius", cursive;
  font-size: 22px;
  font-weight: 400;
  font-style: normal;
}

.set-titles-font {
  font-family: "Great Vibes", cursive;
  font-size: 70px;
  font-weight: 400;
  font-style: normal;
  color: var(--color-1);
}

/* Color scheme */
.color-1 {
  color: #8fbc8f;
}
.color-2 {
  color: #a9d18f;
}
.color-3 {
  color: #c2e0a4;
}
.color-4 {
  color: #e4f2b1;
}
.color-5 {
  color: #f1f8e2;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 50px;
  width: 80%;
}

@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* CSS Variables */
:root {
  --color-1: #8fbc8f;
  --color-2: #a9d18f;
  --color-3: #c2e0a4;
  --color-4: #e4f2b1;
  --color-5: #f1f8e2;
}

.fairies-icon-title {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.fairies-icon-title img {
  width: 100%;
  height: 100px;
  margin-right: 20px;
  object-fit: cover;
  filter: sepia(80%) hue-rotate(90deg) saturate(150%);
}

@media (max-width: 768px) {
  .fairies-icon-title img {
    display: none;
  }

  .set-titles-font {
    font-family: "Great Vibes", cursive;
    font-size: 50px !important;
    font-weight: 400;
    font-style: normal;
    text-align: center;
    color: var(--color-1);
  }
}

section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.articles-style {
  width: 85%;
}

.articles-style div {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 15px;
  margin: 20px;
  padding: 10px;
}

.articles-style div div {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin: 0;
  padding: 0;
  border: unset;
}

.articles-style div img {
  border-radius: 10px;
}

.articles-style h1 {
  text-align: center;
  margin: 0;
  padding: 0;
}

.grid div {
  font-size: 9px;
  padding: 1px;
  text-align: center;
  transition: transform 0.3s ease-in-out;
}

.grid div h4 {
  margin-top: 20px;
  font-size: 50px;
  margin-bottom: 5px;
}

.article-vero {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 90px;
}

.fairy-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.img-style {
  border-radius: 10px;
}

.flip-box {
  background-color: transparent;
  width: 100%;
  height: 335px;
  perspective: 1000px;
  overflow: hidden;
  position: relative;
}

.flip-box-inner {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s ease;
}

.flip-box:hover .flip-box-inner {
  transform: rotateY(180deg);
}

.flip-box-front,
.flip-box-back {
  position: absolute;
  width: 100%;
  height: 300px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 10px;
}

.flip-box-front {
  background-color: var(--color-5);
}

.flip-box-back {
  transform: rotateY(180deg);
}

.gif {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

@media (max-width: 768px) {
  .flip-box-inner,
  .flip-box-front,
  .flip-box-back,
  .flip-toggle {
    all: unset;
  }

  .flip-box {
    position: relative;
    width: 100%;
    height: auto;
    overflow: hidden;
    border-radius: 12px;
  }

  .flip-box-front .img-style {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
  }

  .flip-box-back img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
  }

  .flip-box:active .flip-box-back .gif {
    opacity: 1;
  }
}

.articles-style div div {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.articles-style h1 {
  text-align: center;
}

/* --- ESTILOS GLOBALES --- */
:root {
  --color-text-nav: #ffffff; /* Blanco puro */
  --color-hover-nav: #ff6bcd; /* Rosa en hover */
}

body {
  background: none;
  font-family: "Delius", cursive;
}

/* --- HEADER Y GUIRNALDA --- */
.main-header {
  width: 100%;
  padding-top: 20px;
  display: flex;
  justify-content: center;
  min-height: 250px;
}

.garland-container {
  background-image: url("media/images/guirnalda.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 1000px;
  width: 100%;
  max-width: 1100px;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding-top: 0;
}

.fairy-nav ul {
  list-style: none;
  padding: 0;
  padding-bottom: 20px;
  margin: 0;
  display: flex;
  gap: 20px;
  align-items: center;
  margin-top: 0;
}

.fairy-nav a {
  text-decoration: none;
  color: var(--color-text-nav);
  font-family: "Great Vibes", cursive;
  font-size: 2.5rem;
  font-weight: normal;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), 0 0 10px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

.fairy-nav a:hover {
  color: var(--color-hover-nav);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.4);
  transform: scale(1.1);
}

/* --- CONTENIDO --- */
.content-wrapper {
  max-width: 800px;
  margin: 50px auto;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 40px;
  border-radius: 15px;
  text-align: center;
}

.set-titles-font {
  font-family: "Great Vibes", cursive;
  font-size: 3rem;
  margin-bottom: 20px;
}

.set-text-font {
  font-family: "Delius", cursive;
  font-size: 1.1rem;
  line-height: 1.6;
}

/* ========== RESPONSIVE DESIGN ========== */

/* Tablets y pantallas más pequeñas (hasta 768px) */
@media (max-width: 768px) {
  .garland-container {
    background-size: 800px;
    height: 280px;
  }

  .fairy-nav a {
    font-size: 2rem;
  }

  .fairy-nav ul {
    gap: 15px;
  }

  .content-wrapper {
    margin: 30px 20px;
    padding: 30px;
  }

  .set-titles-font {
    font-size: 2.5rem;
  }
}

/* Móviles (hasta 480px) */
@media (max-width: 480px) {
  .garland-container {
    background-size: 600px;
    height: 220px;
  }

  .fairy-nav ul {
    flex-direction: column;
    gap: 10px;
    padding-bottom: 10px;
  }

  .fairy-nav a {
    font-size: 1.8rem;
  }

  .content-wrapper {
    margin: 20px 15px;
    padding: 20px;
  }

  .set-titles-font {
    font-size: 2rem;
  }

  .set-text-font {
    font-size: 1rem;
  }
}

@media (max-width: 360px) {
  .garland-container {
    background-size: 500px;
    height: 180px;
  }

  .fairy-nav a {
    font-size: 1.6rem;
  }

  .set-titles-font {
    font-size: 1.8rem;
  }
}

/* ========== FOOTER ========== */
.fairy-footer {
  background: var(--color-1);
  color: #fff;
  padding: 40px 20px 20px;
  margin-top: 60px;
  text-align: center;
  width: 100%;
}

.fairy-footer h3 {
  font-family: "Great Vibes", cursive;
  font-size: 2.5rem;
  color: var(--color-4);
  margin-bottom: 10px;
}

.fairy-footer p {
  font-family: "Delius", cursive;
  margin-bottom: 20px;
}

.footer-links,
.footer-members,
.footer-integrantes {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.footer-links a,
.footer-members a,
.footer-integrantes a {
  color: var(--color-5);
  text-decoration: none;
  font-family: "Delius", cursive;
  transition: all 0.3s ease;
}

.footer-links a:hover,
.footer-members a:hover,
.footer-integrantes a:hover {
  color: var(--color-3);
  text-decoration: underline;
}

.footer-integrantes span {
  color: #fff;
  font-family: "Delius", cursive;
  margin-right: 10px;
}

.coming-soon {
  color: rgba(255, 255, 255, 0.6) !important;
  font-style: italic;
}

.coming-soon:hover {
  color: rgba(255, 255, 255, 0.8) !important;
  text-decoration: none !important;
}

.footer-copy {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 20px;
}

/* ========== FOOTER RESPONSIVE ========== */
@media (max-width: 768px) {
  .footer-links,
  .footer-members,
  .footer-integrantes {
    flex-direction: column;
    gap: 10px;
  }

  .footer-integrantes span {
    margin-right: 0;
    margin-bottom: 5px;
  }
}

.fairy-system {
  animation: fadeInSection 1.5s ease forwards;
}
.title-glow {
  animation: glow 3s infinite alternate;
}
.soft-fade {
  animation: floatText 6s ease-in-out infinite;
}

@keyframes glow {
  from {
    text-shadow: 0 0 5px var(--color-1);
  }
  to {
    text-shadow: 0 0 20px var(--color-2), 0 0 40px var(--color-3);
  }
}

@keyframes floatText {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes fadeInSection {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatCard {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.flip-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 40px;
  width: 95%;
  max-width: 1400px;
  margin-top: 30px;
  margin-bottom: 30px;
  perspective: 1200px;
}

.flip-card {
  width: 45%;
  max-width: 600px;
  height: 300px;
  background-color: transparent;
  transition: transform 0.6s;
  animation: floatCard 6s ease-in-out infinite;
}

.flip-card:last-child {
  width: 95%;
  height: 300px;
  margin-left: auto;
  margin-right: auto;
  animation-delay: 0s !important;
}

.flip-card:nth-child(2) {
  animation-delay: 1s;
}
.flip-card:nth-child(3) {
  animation-delay: 2s;
}
.flip-card:nth-child(4) {
  animation-delay: 0.5s;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s;
  transform-style: preserve-3d;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(143, 188, 143, 0.4);
}

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

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 15px;
  padding: 30px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.flip-card-front {
  background: linear-gradient(160deg, var(--color-4) 30%, var(--color-5) 90%);
  color: var(--color-1);
}

.flip-card-front h4 {
  font-family: "Great Vibes", cursive;
  font-size: 55px;
  margin: 10px 0 0;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.15);
}

.flip-card-back {
  background-color: var(--color-2);
  color: var(--color-5);
  transform: rotateY(180deg);
  text-align: center;
  font-size: 18px;
  padding: 30px;
  align-items: center;
  justify-content: center;
}

.flip-card-back ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
  width: 85%;
  text-align: left;
}

.flip-card-back ul li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
  line-height: 1.4;
  text-align: justify;
  text-justify: inter-word;
}

.flip-card-back ul li::before {
  content: "+";
  position: absolute;
  left: 0;
  color: var(--color-1);
  font-weight: bold;
  font-size: 1.1em;
}

.flip-card-back strong {
  color: var(--color-4);
  font-weight: bold;
}

@media (max-width: 1250px) {
  .flip-card {
    width: 45%;
    max-width: 600px;
  }
  .flip-card:last-child {
    width: 90%;
    height: 300px;
  }
}
@media (max-width: 768px) {
  .flip-grid {
    gap: 30px;
  }
  .flip-card,
  .flip-card:last-child {
    width: 90%;
    height: 350px;
  }
}

.fairy-aside {
  background: linear-gradient(135deg, var(--color-5) 0%, var(--color-4) 100%);
  border-left: 5px solid var(--color-1);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 25px;
  border-radius: 10px;
  margin: 40px auto;
  width: 60%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: fadeInAside 1.2s ease;
}

.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 10px 15px;
  background-color: var(--color-1);
  color: white;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.back-to-top:hover {
  opacity: 1;
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
  .back-to-top {
    display: none;
  }

  #race-1:checked ~ .slides {
  transform: translateX(0%);
}

#race-2:checked ~ .slides {
  transform: translateX(-5);
}

#race-3:checked ~ .slides {
  transform: translateX(-10);
}

#race-4:checked ~ .slides {
  transform: translateX(-15);
}

#race-5:checked ~ .slides {
  transform: translateX(-20);
}

#race-6:checked ~ .slides {
  transform: translateX(-25);
}

#race-7:checked ~ .slides {
  transform: translateX(-30);
}




}

.aside-title {
  font-family: "Great Vibes", cursive;
  font-size: 2rem;
  color: var(--color-1);
  margin-bottom: 10px;
  text-align: center;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.7);
}

.fairy-aside p {
  font-family: "Delius", cursive;
  font-size: 1.1rem;
  color: #2f452f;
  margin: 10px 0;
  text-align: justify;
}

/* Animación suave */
@keyframes fadeInAside {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.member-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
}

.fav-fairy {
  margin: 0;
  font-size: 0.9rem;
  font-family: "Delius", cursive;
  color: rgba(255, 255, 255, 0.8);
}

.fav-fairy strong {
  color: var(--color-4);
}

::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--color-5);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--color-3), var(--color-2));
  border-radius: 10px;
  border: 2px solid var(--color-5);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--color-2), var(--color-1));
}

.section-divider {
  width: 80%;
  margin: 40px auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-3), transparent);
  border-radius: 10px;
}

::selection {
  background: var(--color-2);
  color: #1a1f1a;
}

/* ====== CAROUSEL BASE ====== */
.races-carousel {
  width: 90%;
  margin: 50px auto;
  text-align: center;
  position: relative;
}

.races-carousel input[type="radio"] {
  display: none;
}

.slides {
  display: flex;
  width: 700%;
  height: 350px;
  transition: transform 0.6s ease-in-out;
}

.slide {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  box-sizing: border-box;
}

.slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.race-card {
  background: var(--color-5);
  border: 2px solid var(--color-2);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  color: #2f3f2f;
}

.controls {
  margin-top: 20px;
}

.controls label {
  width: 14px;
  height: 14px;
  background: var(--color-3);
  border-radius: 50%;
  display: inline-block;
  margin: 0 6px;
  cursor: pointer;
  transition: 0.3s;
}

.controls label:hover {
  background: var(--color-1);
}

#race-1:checked ~ .slides {
  transform: translateX(0%);
}

#race-2:checked ~ .slides {
  transform: translateX(-14.3%);
}

#race-3:checked ~ .slides {
  transform: translateX(-28.6%);
}

#race-4:checked ~ .slides {
  transform: translateX(-42.9%);
}

#race-5:checked ~ .slides {
  transform: translateX(-57.2%);
}

#race-6:checked ~ .slides {
  transform: translateX(-71.5%);
}

#race-7:checked ~ .slides {
  transform: translateX(-85.8%);
}

/* @keyframes carouselSlide {
  0% {
    transform: translateX(0%);
  }
  25% {
    transform: translateX(0%);
  }

  35% {
    transform: translateX(-33.333%);
  }
  60% {
    transform: translateX(-33.333%);
  }

  70% {
    transform: translateX(-66.666%);
  }
  95% {
    transform: translateX(-66.666%);
  }

  100% {
    transform: translateX(0%);
  }
} */

@media (max-width: 768px) {

  @keyframes carouselSlideMobile {
    0%,
    20% {
      transform: translateX(0%);
    }
    25%,
    45% {
      transform: translateX(-100%);
    }
    50%,
    70% {
      transform: translateX(-200%);
    }
    80%,
    100% {
      transform: translateX(0%);
    }
  }

  .slide {
    width: 100%;
    padding: 20px;
  }
}

@media (prefers-color-scheme: dark) {
  /* Fondo general */
  body {
    background-color: #232b0b !important;
    color: #e8f5e1;
      cursor: url("media/images/magic-wand-dark.ico") 10 10, auto !important;
  }

  ::selection {
    background: var(--color-1);
    color: #0d0f0d;
  }

  .race-card {
    background: rgba(255, 255, 255, 0.07);
    border: 2px solid rgba(190, 240, 190, 0.25);
    color: var(--color-4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  }

  .controls label {
    background: var(--color-1);
  }

  .controls label:hover {
    background: var(--color-2);
  }

  /* Textos */
  .set-text-font {
    color: #dcefd9;
  }

  .set-titles-font {
    color: var(--color-2);
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
  }

  /* Tarjetas */
  .flip-box-front {
    background-color: #232b0b !important;
  }

  .flip-card-front {
    background: linear-gradient(160deg, #3c450b 30%, #1f261f 90%) !important;
    color: var(--color-4);
  }

  .flip-card-back {
    background-color: #365a36 !important;
  }

  /* Footer */
  .fairy-footer {
    background: linear-gradient(135deg, #102010, #1c331c) !important;
  }

  .fairy-footer h3 {
    color: var(--color-4);
  }

  .footer-links a,
  .footer-members a,
  .footer-integrantes a {
    color: var(--color-3);
  }

  .footer-links a:hover,
  .footer-members a:hover,
  .footer-integrantes a:hover {
    color: var(--color-1);
  }

  .team-fairies,
  .fairy-aside {
    background: rgba(255, 255, 255, 0.07) !important;
    border: 2px solid rgba(200, 240, 200, 0.25);
    border-radius: 12px;

    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);

    color: var(--color-4) !important; 
  }

  .team-fairies h3,
  .fairy-aside h3 {
    color: var(--color-3) !important;
    text-shadow: none;
  }

  .team-fairies li,
  .fairy-aside li {
    color: var(--color-4) !important;
  }

  .fav-fairy strong {
    color: var(--color-2) !important;
  }

  .fairy-aside p {
    color: #ffffffcc;
  }

  ::-webkit-scrollbar-track {
    background: #161d16 !important;
  }

  ::-webkit-scrollbar-thumb {
    background: linear-gradient(
      180deg,
      var(--color-1),
      var(--color-2)
    ) !important;
    border: 2px solid #161d16 !important;
  }

  .fairy-footer p {
    color: #ffffffcc;
  }

  @media (prefers-color-scheme: dark) {
    .race-card {
      background: rgba(255, 255, 255, 0.05);
      border: 2px solid rgba(180, 230, 180, 0.3);
      color: var(--color-4);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }

    .controls label {
      background: var(--color-1);
    }

    .controls label:hover {
      background: var(--color-2);
    }
  }
}
