:root {
  --dark-green: #142C14;
  --cal-poly: #2D5128;
  --fern-green: #537B2F;
  --asparagus: #8DA750;
  --mindaro: #d3dfc5;
  --blanco-puro: #ffffff;
  --texto-base: #2D5128;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background-color: var(--mindaro);
  color: var(--texto-base);
  font-family: 'Quicksand', sans-serif;
  background-image: url("https://www.transparenttextures.com/patterns/natural-paper.png");
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- NAVEGACIÓN Y CABECERA --- */
.brand-corner {
  position: absolute;
  top: 25px;
  left: 30px;
  font-family: 'DM Serif Display', serif;
  font-size: 1.8rem;
  color: var(--cal-poly);
  z-index: 2000;
  text-transform: lowercase;
}

nav { padding: 50px 20px; display: flex; justify-content: center; }
nav ul {
  display: flex; gap: 10px; list-style: none;
  background: var(--blanco-puro); padding: 15px 30px;
  border-radius: 100px; border: 3px solid var(--asparagus);
  box-shadow: 0 15px 35px rgba(45, 81, 40, 0.15);
}
nav li { padding: 12px 22px; border-radius: 50px; transition: all 0.4s ease; }
nav a { text-decoration: none; color: var(--cal-poly); font-weight: 600; text-transform: uppercase; }
nav li:hover { background: var(--fern-green); transform: scale(1.1); }
nav li:hover a { color: white; }

/* --- MARCO DE LOS JUEGOS --- */
.game-frame {
  max-width: 900px;
  margin: 40px auto 80px;
  padding: 20px;
  background: var(--blanco-puro);
  border: 15px solid var(--blanco-puro);
  outline: 3px dashed var(--asparagus);
  border-radius: 50px;
  box-shadow: 20px 20px 0px var(--asparagus), 0 30px 60px rgba(0,0,0,0.1);
  animation: fadeInUp 1.2s ease-out;
}

.game-content {
  background: var(--mindaro); /* Vuelve el color crema suave de fondo */
  padding: 50px 20px;
  border-radius: 35px;
  text-align: center;
}

.game-title {
  font-family: 'DM Serif Display', serif;
  font-size: 3rem;
  color: var(--dark-green);
  margin-bottom: 10px;
}

.game-separator {
  font-size: 1.5rem;
  color: var(--fern-green);
  margin-bottom: 30px;
}

/* --- ESTILOS PIEDRA, PAPEL, TIJERA --- */
.scoreboard {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 40px;
}

.score-card {
  background: var(--blanco-puro);
  padding: 15px 30px;
  border-radius: 20px;
  border-bottom: 5px solid var(--asparagus);
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--cal-poly);
}

.choices {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.choice-btn {
  cursor: pointer;
  border: none;
  background: var(--blanco-puro);
  padding: 15px;
  border-radius: 25px;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 8px 15px rgba(0,0,0,0.05);
}

.choice-btn:hover {
  transform: scale(1.1) rotate(3deg);
  box-shadow: 0 15px 30px rgba(45, 81, 40, 0.2);
}

.choice-btn img { width: 100%; height: auto; border-radius: 15px; }

#result {
  font-size: 1.4rem;
  color: var(--dark-green);
  margin-bottom: 30px;
  font-weight: 600;
  min-height: 1.5em;
}

.btn-reset {
  background: var(--fern-green);
  color: white;
  border: none;
  padding: 15px 40px;
  border-radius: 100px;
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 20px rgba(83, 123, 47, 0.3);
}

.btn-reset:hover {
  background: var(--dark-green);
  transform: translateY(-3px);
}

/* --- ESTILOS EXTRA PARA MEMORAMA (COLORES ORIGINALES) --- */
.memory-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  padding: 20px;
  background: rgba(20, 44, 20, 0.1); /* Fondo sutil para el área de juego */
  border-radius: 25px;
}

.cards {
  height: 500px;
  width: 500px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  list-style: none;
  padding: 0;
}

.cards .card {
  cursor: pointer;
  position: relative;
  perspective: 1000px;
  transform-style: preserve-3d;
  height: calc(100% / 4 - 10px);
  width: calc(100% / 4 - 10px);
}

.card .view {
  width: 100%;
  height: 100%;
  position: absolute;
  border-radius: 12px;
  background: var(--cal-poly); /* Verde oscuro original */
  backface-visibility: hidden;
  border: 2px solid var(--asparagus);
  transition: transform 0.4s linear;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Flor blanca detrás */
.card .front-view img {
  width: 45px;
  content: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M12,22C12,22 13,18 15,15C17,12 21,11 21,11C21,11 17,10 15,7C13,4 12,0 12,0C12,0 11,4 9,7C7,10 3,11 3,11C3,11 7,12 9,15C11,18 12,22 12,22Z'/></svg>");
  filter: drop-shadow(0 0 5px rgba(255,255,255,0.3));
}

.card .back-view {
  transform: rotateY(180deg);
  background: var(--blanco-puro); /* Fondo blanco para las imágenes frontales */
}

.card.flip .front-view { transform: rotateY(-180deg); }
.card.flip .back-view { transform: rotateY(0deg); }

.card .back-view img {
  width: 85%;
  max-width: 85px;
  object-fit: contain;
}

/* Modal de Victoria Estilizado */
.victory-hidden {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(20, 44, 20, 0.95);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.victory-hidden.show { display: flex; animation: fadeInUp 0.5s ease; }

.victory-content {
  background: var(--blanco-puro);
  padding: 50px;
  border-radius: 40px;
  text-align: center;
  border: 8px solid var(--asparagus);
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.victory-content h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 3rem;
  color: var(--dark-green);
  margin-bottom: 10px;
}

/* Animación de error */
.card.shake { animation: shake 0.35s ease-in-out; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
}

footer {
  text-align: center;
  padding: 60px;
  background: var(--cal-poly);
  color: var(--mindaro);
  letter-spacing: 4px;
  text-transform: uppercase;
  font-size: 0.9rem;
  margin-top: auto;
}

@media (max-width: 600px) {
  .game-frame { margin: 20px; padding: 10px; }
  .cards { width: 320px; height: 320px; }
  .choice-btn { width: 100px; height: 100px; }
}




/* Estilo para el botón de Juego de Disparos */
.btn-play-shooter {
    display: inline-block;
    padding: 15px 40px;
    background-color: #4a6741; /* Verde bosque suave */
    color: #ffffff !important;
    text-decoration: none;
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 1px;
    border-radius: 50px; /* Bordes redondeados orgánicos */
    border: 2px solid #5d8251;
    transition: all 0.4s ease;
    box-shadow: 0 4px 15px rgba(74, 103, 65, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-play-shooter:hover {
    background-color: #5d8251;
    transform: translateY(-3px); /* Efecto de flotado */
    box-shadow: 0 6px 20px rgba(74, 103, 65, 0.4);
    letter-spacing: 2px;
}

.btn-play-shooter:active {
    transform: translateY(-1px);
}

/* Decoración de hojita opcional antes del texto */
.btn-play-shooter::before {
    content: '🌿';
    margin-right: 10px;
    transition: transform 0.3s ease;
}

.btn-play-shooter:hover::before {
    display: inline-block;
    transform: rotate(20deg) scale(1.2);
}