:root {
    --primary-color: #2c3e50;
    --secondary-color: #1468a0;
    --background-color: #f4f6f7;
    --card-background: #ffffff;
    --text-color: #34495e;
    --light-text: #ffffff;
    --header-bg: #ffffff;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex-grow: 1;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    text-align: left;
}

/* --- Header y Navegación --- */
header {
    background-color: var(--header-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 25px;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 5px;
    transition: color 0.3s, background-color 0.3s;
}

nav a:hover {
    color: var(--secondary-color);
    background-color: #ecf0f1;
}

/* --- Contenido Principal y Controles --- */
#generator {
    padding-top: 50px;
    padding-bottom: 50px;
}

h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: #4d4d4d;
    margin-top: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.controls {
    background-color: var(--card-background);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin: 30px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.controls label {
    font-weight: 600;
}

input[type="number"] {
    width: 60px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #bdc3c7;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    text-align: center;
}

button {
    background-color: var(--secondary-color);
    color: var(--light-text);
    border: none;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.result-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 20px 0;
    min-height: 420px; /* Evita que el layout salte */
}

/* --- Cartas de Animales (sin cambios) --- */
.card-scene { width: 280px; height: 400px; perspective: 1000px; }
.card { width: 100%; height: 100%; position: relative; transition: transform 1s; transform-style: preserve-3d; }
.card.is-flipped { transform: rotateY(180deg); }
.card-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; border-radius: 15px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); overflow: hidden; }
.card-front { background: linear-gradient(135deg, #6dd5ed, #2193b0); color: white; display: flex; justify-content: center; align-items: center; font-size: 5rem; font-weight: bold; }
.card-back { background-color: var(--card-background); transform: rotateY(180deg); display: flex; flex-direction: column; }
.card-back img { width: 100%; height: 180px; object-fit: cover; }
.card-content { padding: 15px; text-align: left; flex-grow: 1; }
.card-content h3 { margin-top: 0; color: var(--primary-color); font-size: 1.4rem; }
.card-content p { font-size: 0.9rem; line-height: 1.5; }

/* --- Sección "Sobre la App" y Footer (sin cambios) --- */
.about-section {
    background-color: #ffffff;
    padding: 60px 20px;
    border-top: 1px solid #e0e0e0;
}
.about-section h2 { font-size: 2rem; color: var(--primary-color); }
.about-section p { max-width: 1200px; margin: 15px auto 0; line-height: 1.7; }

footer {
    background-color: var(--primary-color);
    color: #bdc3c7;
    text-align: center;
    padding: 20px;
    margin-top: auto;
}
footer p { margin: 0; font-size: 0.9rem; }

/* --- Menú responsivo para móviles --- */
@media (max-width: 768px) {
    header {
        position: static;
        box-shadow: none;
    }
    .header-container {
        flex-direction: column;
        height: auto;
        align-items: flex-start;
        padding: 10px 0;
    }
    .logo {
        margin-bottom: 10px;
        width: 100%;
        display: flex;
        justify-content: center;
    }
    nav ul {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        align-items: center;
    }
    nav a {
        width: 100%;
        text-align: center;
        padding: 10px 0;
    }
    .generator-wrapper, .subtitle, .container{
        width: 85%;
    }
}
