/* ===== ESTILOS GLOBALES ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive, sans-serif;
    background: linear-gradient(135deg, #d4f1c5 0%, #a8d8a0 50%, #7bc47f 100%);
    min-height: 100vh;
    padding: 15px;
    margin: 0;
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.contenedor {
    max-width: 950px;
    width: 100%;
    margin: 0 auto;
    background: rgba(255, 248, 230, 0.92);
    backdrop-filter: blur(6px);
    border-radius: 80px 80px 60px 60px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15),
                0 0 0 8px #8bc98e,
                0 0 0 14px #e2f0d0;
    padding: 30px 25px 35px;
    text-align: center;
}

h1 {
    font-size: 3.2rem;
    font-weight: 700;
    color: #2d5a1e;
    text-shadow: 5px 5px 0 #9fd194, 7px 7px 0 rgba(0, 0, 0, 0.08);
    letter-spacing: 2px;
    margin-top: -8px;
    margin-bottom: 8px;
}

.subtitulo {
    font-size: 1.2rem;
    color: #3d6b2a;
    background: #dff0c0;
    display: inline-block;
    padding: 6px 28px;
    border-radius: 60px;
    box-shadow: inset 0 -3px 0 #8bb87a;
    margin-bottom: 18px;
    font-weight: 600;
}

/* ===== ESTADÍSTICAS ===== */
.estadisticas {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.contador {
    font-size: 1.5rem;
    background: #dcedc8;
    padding: 10px 22px;
    border-radius: 60px;
    box-shadow: inset 0 -4px 0 #8fb282;
    font-weight: 600;
    color: #2d4a1e;
    flex: 1 1 auto;
    min-width: 150px;
}

.contador span {
    background: #2d4a1e;
    color: #f0ffe0;
    padding: 0 18px;
    border-radius: 40px;
    margin-left: 8px;
    font-size: 2rem;
    min-width: 50px;
    display: inline-block;
}

.nivel {
    font-size: 1.5rem;
    background: #ffd99b;
    padding: 10px 22px;
    border-radius: 60px;
    box-shadow: inset 0 -4px 0 #c49a6a;
    font-weight: 600;
    color: #4d3a1e;
    flex: 1 1 auto;
    min-width: 150px;
}

.nivel span {
    background: #4d3a1e;
    color: #ffedc0;
    padding: 0 18px;
    border-radius: 40px;
    margin-left: 8px;
    font-size: 2rem;
    min-width: 40px;
    display: inline-block;
}

/* ===== ZONA DEL JARDÍN ===== */
.jardin {
    background: linear-gradient(180deg, #e8f5d8 0%, #cce3b5 100%);
    border-radius: 120px 120px 60px 60px;
    padding: 25px 20px 20px 20px;
    margin: 8px 0 18px 0;
    box-shadow: inset 0 -8px 0 #8fb282, 0 12px 28px rgba(0, 0, 0, 0.10);
    border: 4px solid #b5d6a0;
    position: relative;
    cursor: pointer;
    transition: all 0.15s;
}

.jardin:active {
    transform: scale(0.97);
}

.elemento-jardin {
    position: relative;
    z-index: 2;
}

#emoji-principal {
    font-size: 8rem;
    line-height: 1.2;
    display: block;
    user-select: none;
    transition: transform 0.2s ease, filter 0.3s ease;
    filter: drop-shadow(4px 8px 12px rgba(0, 0, 0, 0.12));
}

#nombre-elemento {
    font-size: 2.6rem;
    font-weight: bold;
    color: #2d4a1e;
    background: rgba(255, 245, 200, 0.85);
    display: inline-block;
    padding: 2px 35px;
    border-radius: 60px;
    margin-top: 2px;
    letter-spacing: 1px;
    backdrop-filter: blur(4px);
}

.decoracion {
    position: absolute;
    top: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    font-size: 2rem;
    opacity: 0.7;
    pointer-events: none;
    z-index: 1;
}

/* ===== BOTONES DE ELEMENTOS ===== */
.grid-elementos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 25px 0 18px 0;
}

.btn-elemento {
    background: #f5ffe0;
    border: 4px solid #8fc97e;
    border-radius: 100px;
    padding: 12px 0;
    font-size: 2.8rem;
    cursor: pointer;
    box-shadow: 0 8px 0 #699b5a, 0 6px 14px rgba(0, 0, 0, 0.10);
    transition: all 0.06s linear;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
    user-select: none;
}

.btn-elemento span {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2d4a1e;
    background: #dcedc8;
    padding: 2px 14px;
    border-radius: 30px;
    margin-top: 4px;
    letter-spacing: 0.5px;
}

.btn-elemento:active {
    transform: translateY(7px);
    box-shadow: 0 1px 0 #699b5a;
}

.btn-elemento:hover {
    background: #f0ffe0;
    border-color: #7bb86a;
}

/* ===== BOTONES DE ACCIÓN ===== */
.acciones {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin: 16px 0 20px 0;
}

.btn-accion {
    background: #f5e6b0;
    border: none;
    border-radius: 80px;
    padding: 14px 28px;
    font-size: 1.6rem;
    font-weight: bold;
    color: #3d5a2a;
    box-shadow: 0 7px 0 #b3976a, 0 6px 16px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.06s linear;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 3px solid #ecdbaa;
    flex: 1 1 auto;
    justify-content: center;
}

.btn-accion:active {
    transform: translateY(7px);
    box-shadow: 0 1px 0 #b3976a;
}

.btn-accion span {
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.4);
    padding: 0 12px;
    border-radius: 40px;
}

/* ===== TIENDA ===== */
.tienda {
    margin: 25px 0 20px 0;
    background: #f5f0e0;
    border-radius: 60px;
    padding: 20px 15px;
    border: 4px solid #b5d6a0;
    box-shadow: inset 0 -6px 0 #8fb282;
}

.titulo-tienda {
    font-size: 2rem;
    color: #2d5a1e;
    margin-bottom: 18px;
    text-shadow: 2px 2px 0 #d4e8b0;
}

.grid-tienda {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.producto {
    background: #fffdf5;
    border-radius: 40px;
    padding: 15px 10px;
    border: 3px solid #c5dba8;
    box-shadow: 0 4px 0 #8fb282;
    transition: all 0.1s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.producto-emoji {
    font-size: 3rem;
}

.producto-nombre {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d4a1e;
}

.producto-precio {
    font-size: 1rem;
    font-weight: bold;
    color: #5a3d1a;
    background: #ffecb0;
    padding: 2px 14px;
    border-radius: 30px;
}

.btn-comprar {
    background: #ffd99b;
    border: none;
    border-radius: 40px;
    padding: 8px 24px;
    font-size: 1rem;
    font-weight: bold;
    color: #3d2a0e;
    cursor: pointer;
    box-shadow: 0 4px 0 #b3976a;
    transition: all 0.06s linear;
    font-family: inherit;
    margin-top: 4px;
}

.btn-comprar:active {
    transform: translateY(4px);
    box-shadow: 0 0px 0 #b3976a;
}

.btn-comprar:hover {
    background: #ffd080;
}

.btn-comprar:disabled {
    opacity: 0.5;
    transform: translateY(4px);
    box-shadow: 0 0px 0 #b3976a;
    cursor: not-allowed;
}

/* ===== INVENTARIO ===== */
.inventario {
    margin: 20px 0 15px 0;
    background: #e8f0d8;
    border-radius: 60px;
    padding: 20px 15px;
    border: 4px solid #b5d6a0;
    box-shadow: inset 0 -6px 0 #8fb282;
    min-height: 80px;
}

.titulo-inventario {
    font-size: 1.8rem;
    color: #2d5a1e;
    margin-bottom: 12px;
    text-shadow: 2px 2px 0 #d4e8b0;
}

.grid-inventario {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    min-height: 50px;
    align-items: center;
}

.mensaje-vacio {
    color: #6a8a5a;
    font-size: 1.1rem;
    font-style: italic;
    opacity: 0.7;
}

.item-inventario {
    background: #fffdf5;
    border-radius: 30px;
    padding: 8px 16px;
    border: 3px solid #8fc97e;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    animation: aparecer 0.3s ease;
    box-shadow: 0 3px 0 #699b5a;
}

.item-inventario span {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2d4a1e;
}

@keyframes aparecer {
    0% { transform: scale(0) rotate(-10deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* ===== ANIMACIONES ===== */
@keyframes flotar {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.flotando {
    animation: flotar 1.5s ease-in-out infinite;
}

@keyframes brillar {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

.brillando {
    animation: brillar 0.8s ease-in-out 3;
}

/* ===== MENSAJE INFERIOR ===== */
.mensaje-inferior {
    margin-top: 18px;
    font-size: 1.1rem;
    color: #3d6b2a;
    background: #dff0c0;
    border-radius: 40px;
    padding: 8px 14px;
    display: inline-block;
    width: auto;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
    .contenedor {
        padding: 20px 15px 25px;
        border-radius: 50px;
    }

    h1 {
        font-size: 2.4rem;
    }

    #emoji-principal {
        font-size: 5.5rem;
    }

    #nombre-elemento {
        font-size: 2rem;
        padding: 2px 18px;
    }

    .grid-elementos {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .btn-elemento {
        font-size: 2.4rem;
        padding: 10px 0;
    }

    .btn-accion {
        font-size: 1.3rem;
        padding: 12px 16px;
        gap: 6px;
    }

    .grid-tienda {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .decoracion {
        font-size: 1.5rem;
        padding: 0 10px;
    }

    .estadisticas {
        flex-direction: column;
        align-items: stretch;
    }

    .contador, .nivel {
        min-width: auto;
    }
}

@media (max-width: 450px) {
    #emoji-principal {
        font-size: 4rem;
    }
    .btn-elemento {
        font-size: 2rem;
    }
    .grid-tienda {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .producto {
        padding: 12px 8px;
    }
    .producto-emoji {
        font-size: 2.2rem;
    }
    .btn-comprar {
        padding: 6px 16px;
        font-size: 0.85rem;
    }
}